summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorCharlène <julianaito@posteo.jp>2020-02-11 12:45:36 +0100
committerCharles Pigott <charlespigott@googlemail.com>2020-02-11 13:01:45 +0000
commit2196cd3cf87f2fa164ad746b87e2686e2b207158 (patch)
tree7a2d701e3f45753da578e2942164b75b9d76b5ef /src/core
parent183c2a35bd6ec194e063267155bcc63e59891525 (diff)
downloadopenttd-2196cd3cf87f2fa164ad746b87e2686e2b207158.tar.xz
Fix: OpenBSD endianness detection
Diffstat (limited to 'src/core')
-rw-r--r--src/core/endian_type.hpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/core/endian_type.hpp b/src/core/endian_type.hpp
index b674928ee..1b927ef45 100644
--- a/src/core/endian_type.hpp
+++ b/src/core/endian_type.hpp
@@ -33,6 +33,13 @@
# else
# define TTD_ENDIAN TTD_BIG_ENDIAN
# endif
+#elif defined(__OpenBSD__)
+# include <endian.h>
+# if BYTE_ORDER == LITTLE_ENDIAN
+# define TTD_ENDIAN TTD_LITTLE_ENDIAN
+# else
+# define TTD_ENDIAN TTD_BIG_ENDIAN
+# endif
#elif !defined(TESTING)
# include <sys/param.h>
# if __BYTE_ORDER == __LITTLE_ENDIAN