From: Dagobert Michelsen Date: Thu, 3 May 2018 10:42:28 +0000 (+0200) Subject: Add endianness checks for AIX X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=7f4a04eb1a4b9e4e6b81c2e0394e13bd532b5317;p=collectd.git Add endianness checks for AIX --- diff --git a/src/stdendian.h b/src/stdendian.h index 2fc569ce..9ab0fb59 100644 --- a/src/stdendian.h +++ b/src/stdendian.h @@ -109,6 +109,23 @@ #define __ENDIAN_DEFINED 1 #endif /* sun */ +/* AIX */ +#if defined(_AIX) +#include +#if BYTE_ORDER == LITTLE_ENDIAN +#define _LITTLE_ENDIAN 1234 +#define _BIG_ENDIAN 4321 +#define _BYTE_ORDER _LITTLE_ENDIAN +#elif BYTE_ORDER == BIG_ENDIAN +#define _LITTLE_ENDIAN 1234 +#define _BIG_ENDIAN 4321 +#define _BYTE_ORDER _BIG_ENDIAN +#else +#error Could not determine CPU byte order for AIX +#endif +#define __ENDIAN_DEFINED 1 +#endif /* AIX */ + /* Windows */ #if defined(_WIN32) || defined(_MSC_VER) /* assumes all Microsoft targets are little endian */