--- a/third_party/rapidyaml/rapidyaml-0.10.0.hpp +++ b/third_party/rapidyaml/rapidyaml-0.10.0.hpp @@ -614,6 +614,15 @@ C4_FOR_EACH(PRN_STRUCT_OFFSETS, a, b, c) # endif # define C4_BYTE_ORDER _C4EB +#elif defined(__GNUC__) && defined(__SIZEOF_POINTER__) && defined(__BYTE_ORDER__) + /* generic GCC compatible fallback, e.g. alpha, hppa, m68k, sh */ +# define C4_WORDSIZE __SIZEOF_POINTER__ +# if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ +# define C4_BYTE_ORDER _C4EB +# else +# define C4_BYTE_ORDER _C4EL +# endif + #elif defined(SWIG) # error "please define CPU architecture macros when compiling with swig"