projects
/
collectd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
f9c85b8
)
Add endianness checks for AIX
author
Dagobert Michelsen
<dam@opencsw.org>
Thu, 3 May 2018 10:42:28 +0000
(12:42 +0200)
committer
Pavel Rochnyack
<pavel2000@ngs.ru>
Wed, 23 May 2018 08:06:00 +0000
(15:06 +0700)
src/stdendian.h
patch
|
blob
|
history
diff --git
a/src/stdendian.h
b/src/stdendian.h
index
2fc569c
..
9ab0fb5
100644
(file)
--- a/
src/stdendian.h
+++ b/
src/stdendian.h
@@
-109,6
+109,23
@@
#define __ENDIAN_DEFINED 1
#endif /* sun */
#define __ENDIAN_DEFINED 1
#endif /* sun */
+/* AIX */
+#if defined(_AIX)
+#include <sys/machine.h>
+#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 */
/* Windows */
#if defined(_WIN32) || defined(_MSC_VER)
/* assumes all Microsoft targets are little endian */