summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGravatar Nikias Bassen2012-02-12 00:00:31 +0100
committerGravatar Nikias Bassen2012-02-12 00:00:31 +0100
commitd01bdae204ceaf2bd658d4cc303e79adb1e7e3a8 (patch)
tree368defeff5e511c1897f0625e3812cf8a0d72af9 /src
parentc5173d46a16220a743593e28359770c54adcc65b (diff)
downloadlibplist-d01bdae204ceaf2bd658d4cc303e79adb1e7e3a8.tar.gz
libplist-d01bdae204ceaf2bd658d4cc303e79adb1e7e3a8.tar.bz2
set PLIST_BYTE_ORDER if required and compiler provides it
Diffstat (limited to 'src')
-rw-r--r--src/common.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/common.h b/src/common.h
index e044cbb..beb4a2b 100644
--- a/src/common.h
+++ b/src/common.h
@@ -4,6 +4,15 @@
#define PLIST_LITTLE_ENDIAN 0
#define PLIST_BIG_ENDIAN 1
+#ifndef PLIST_BYTE_ORDER
+#if __BIG_ENDIAN__ == 1
+#define PLIST_BYTE_ORDER PLIST_BIG_ENDIAN
+#endif
+#if __LITTLE_ENDIAN__ == 1
+#define PLIST_BYTE_ORDER PLIST_LITTLE_ENDIAN
+#endif
+#endif
+
#if defined(__GNUC__) && (__GNUC__ >= 4) && !defined(__CYGWIN__) && !defined(WIN32)
# define _PLIST_INTERNAL __attribute__((visibility("hidden")))
#elif defined(__SUNPRO_C) && (__SUNPRO_C >= 0x550)