aboutsummaryrefslogtreecommitdiff
path: root/src/bytorder.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/bytorder.h')
-rw-r--r--src/bytorder.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/bytorder.h b/src/bytorder.h
index cb8231e..2551950 100644
--- a/src/bytorder.h
+++ b/src/bytorder.h
@@ -2,13 +2,14 @@
# error Cannot define both ALF_LSB_FIRST and ALF_MSB_FIRST
#endif
+/* user defined one or the other in COPT, use it. */
#if defined(ALF_LSB_FIRST) || defined(ALF_MSB_FIRST)
# define ALF_ENDIAN_OK
#endif
/* try to get the byte order on this platform.
if we succeed, either ALF_LSB_FIRST or ALF_MSB_FIRST will
- defined, and so will ALF_ENDIAN_OK. */
+ be defined, and so will ALF_ENDIAN_OK. */
#ifndef ALF_ENDIAN_OK
# if defined(__BYTE_ORDER__)
@@ -24,12 +25,13 @@
# endif
#endif
+/* if the __BYTE_ORDER__ macro wasn't defined... */
#ifndef ALF_ENDIAN_OK
-# if defined(__LITTLE_ENDIAN__)
+# if defined(__LITTLE_ENDIAN__ || defined __LITTLE_ENDIAN || defined LITTLE_ENDIAN)
# define ALF_LSB_FIRST
# define ALF_ENDIAN_OK
# else
-# if defined(__BIG_ENDIAN__)
+# if defined(__BIG_ENDIAN__ || defined __BIG_ENDIAN || defined BIG_ENDIAN)
# define ALF_MSB_FIRST
# define ALF_ENDIAN_OK
# endif