]> git.sur5r.net Git - openldap/commitdiff
Add Solaris byte-order detection
authorHoward Chu <hyc@symas.com>
Wed, 9 Nov 2011 03:04:39 +0000 (19:04 -0800)
committerHoward Chu <hyc@symas.com>
Wed, 9 Nov 2011 03:04:39 +0000 (19:04 -0800)
libraries/libmdb/mdb.c

index f3adb66fb056ce6d9b1a6fce9a5d51f4712d3092..e14e141a8b0494ed8d24de0661c8b4a2b13b8422 100644 (file)
 #endif
 
 #ifndef BYTE_ORDER
-#define BYTE_ORDER     __BYTE_ORDER
+# if (defined(_LITTLE_ENDIAN) || defined(_BIG_ENDIAN)) && !(defined(_LITTLE_ENDIAN) && defined(_BIG_ENDIAN))
+/* Solaris just defines one or the other */
+#  define LITTLE_ENDIAN        1234
+#  define BIG_ENDIAN   4321
+#  ifdef _LITTLE_ENDIAN
+#   define BYTE_ORDER  LITTLE_ENDIAN
+#  else
+#   define BYTE_ORDER  BIG_ENDIAN
+#  endif
+# else
+#  define BYTE_ORDER   __BYTE_ORDER
+# endif
 #endif
+
 #ifndef LITTLE_ENDIAN
 #define LITTLE_ENDIAN  __LITTLE_ENDIAN
 #endif