From: Doug MacEachern Date: Fri, 10 Apr 2009 21:54:11 +0000 (-0700) Subject: Restore BYTE_ORDER on DARWIN The files matching grep "define _POSIX_C_SOURCE" src... X-Git-Tag: collectd-4.5.4~23 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=86278412535aeeb0e8e2c50df9029f1b0920e4d8;p=collectd.git Restore BYTE_ORDER on DARWIN The files matching grep "define _POSIX_C_SOURCE" src/*.c on MacOSX do not compile: In file included from target_notification.c:60: collectd.h:172:3: error: #error "Cannot determine byte order" See /usr/include/i386/endian.h: #if defined(KERNEL) || (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)) #define LITTLE_ENDIAN __DARWIN_LITTLE_ENDIAN #define BIG_ENDIAN __DARWIN_BIG_ENDIAN #define BYTE_ORDER __DARWIN_BYTE_ORDER Signed-off-by: Doug MacEachern Signed-off-by: Florian Forster --- diff --git a/src/collectd.h b/src/collectd.h index 6fed9002..24e5add3 100644 --- a/src/collectd.h +++ b/src/collectd.h @@ -139,6 +139,8 @@ # define BYTE_ORDER _BYTE_ORDER # elif defined(__BYTE_ORDER) # define BYTE_ORDER __BYTE_ORDER +# elif defined(__DARWIN_BYTE_ORDER) +# define BYTE_ORDER __DARWIN_BYTE_ORDER # endif #endif #ifndef BIG_ENDIAN @@ -146,6 +148,8 @@ # define BIG_ENDIAN _BIG_ENDIAN # elif defined(__BIG_ENDIAN) # define BIG_ENDIAN __BIG_ENDIAN +# elif defined(__DARWIN_BIG_ENDIAN) +# define BIG_ENDIAN __DARWIN_BIG_ENDIAN # endif #endif #ifndef LITTLE_ENDIAN @@ -153,6 +157,8 @@ # define LITTLE_ENDIAN _LITTLE_ENDIAN # elif defined(__LITTLE_ENDIAN) # define LITTLE_ENDIAN __LITTLE_ENDIAN +# elif defined(__DARWIN_LITTLE_ENDIAN) +# define LITTLE_ENDIAN __DARWIN_LITTLE_ENDIAN # endif #endif #ifndef BYTE_ORDER