From 86278412535aeeb0e8e2c50df9029f1b0920e4d8 Mon Sep 17 00:00:00 2001 From: Doug MacEachern Date: Fri, 10 Apr 2009 14:54:11 -0700 Subject: [PATCH] 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 --- src/collectd.h | 6 ++++++ 1 file changed, 6 insertions(+) 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 -- 2.30.2