aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2017-01-03 16:09:05 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2017-01-03 16:09:05 +0200
commitbfde8b9439e0870fdb34896f61fe3fd90b9e7657 (patch)
tree562fc5d455017f13afded9165cba69a97f0ef50f
parentfcf9219b8ff6e9d21c4f4748dc822a7b92310975 (diff)
Update endianess detection code
-rw-r--r--xml/details/build2/config.h35
1 files changed, 18 insertions, 17 deletions
diff --git a/xml/details/build2/config.h b/xml/details/build2/config.h
index 6ec1c2f..e10b8ee 100644
--- a/xml/details/build2/config.h
+++ b/xml/details/build2/config.h
@@ -13,24 +13,25 @@
# define LIBSTUDXML_BUILD2
#endif
-#ifdef _WIN32
-# ifndef BYTE_ORDER
-# define BIG_ENDIAN 4321
-# define LITTLE_ENDIAN 1234
-# define BYTE_ORDER LITTLE_ENDIAN
-# endif
+#ifdef __FreeBSD__
+# include <sys/endian.h> /* BYTE_ORDER */
#else
-# include <sys/param.h> /* BYTE_ORDER/__BYTE_ORDER, BSD */
-# ifdef BSD
-# include <sys/endian.h> /* BYTE_ORDER */
-# endif
-# ifndef BYTE_ORDER
-# ifdef __BYTE_ORDER
-# define BYTE_ORDER __BYTE_ORDER
-# define BIG_ENDIAN __BIG_ENDIAN
-# define LITTLE_ENDIAN __LITTLE_ENDIAN
-# else
-# error no BYTE_ORDER/__BYTE_ORDER define
+# if defined(_WIN32)
+# ifndef BYTE_ORDER
+# define BIG_ENDIAN 4321
+# define LITTLE_ENDIAN 1234
+# define BYTE_ORDER LITTLE_ENDIAN
+# endif
+# else
+# include <sys/param.h> /* BYTE_ORDER/__BYTE_ORDER */
+# ifndef BYTE_ORDER
+# ifdef __BYTE_ORDER
+# define BYTE_ORDER __BYTE_ORDER
+# define BIG_ENDIAN __BIG_ENDIAN
+# define LITTLE_ENDIAN __LITTLE_ENDIAN
+# else
+# error no BYTE_ORDER/__BYTE_ORDER define
+# endif
# endif
# endif
#endif