ext/include/iv/byteorder.h in iv-phonic-0.1.2 vs ext/include/iv/byteorder.h in iv-phonic-0.1.3

- old
+ new

@@ -1,11 +1,25 @@ #ifndef _IV_BYTEORDER_H_ #define _IV_BYTEORDER_H_ #include <sys/types.h> -#ifdef __GNUC__ +#if defined(__FreeBSD__) || defined(__APPLE__) + +#if defined(__FreeBSD__) +#include <sys/endian.h> +#else +#include <machine/endian.h> +#endif // defined(__FreeBSD__) + +#define __BYTE_ORDER BYTE_ORDER +#define __LITTLE_ENDIAN LITTLE_ENDIAN +#define __BIG_ENDIAN BIG_ENDIAN + +#elif defined(__GNUC__) + #include <endian.h> + #endif #if !defined(__BYTE_ORDER) || (__BYTE_ORDER != __LITTLE_ENDIAN && __BYTE_ORDER != __BIG_ENDIAN) #error BYTE_ORDER not defined. you shoud define __LITTLE_ENDIAN or __BIG_ENDIAN #endif