aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorramrunner <dsp@2f30.org>2016-12-05 16:58:58 -0700
committerramrunner <dsp@2f30.org>2016-12-05 16:58:58 -0700
commit4cc160e1961a7abcd236b37c804774f7ef743eaa (patch)
treeb54e383f98066d67d4e939ec0bbb48f9ed6afcdc
parent734930f9197b7bc97c3c794c7a949fee2a08c280 (diff)
downloadprotobuf-4cc160e1961a7abcd236b37c804774f7ef743eaa.tar.gz
protobuf-4cc160e1961a7abcd236b37c804774f7ef743eaa.tar.bz2
protobuf-4cc160e1961a7abcd236b37c804774f7ef743eaa.zip
when on OpenBSD we include the correct headers for endianess and check the apropriate defines
-rw-r--r--src/google/protobuf/stubs/port.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/google/protobuf/stubs/port.h b/src/google/protobuf/stubs/port.h
index 376be5f7..d5ef166e 100644
--- a/src/google/protobuf/stubs/port.h
+++ b/src/google/protobuf/stubs/port.h
@@ -60,8 +60,12 @@
#endif
#else
#include <sys/param.h> // __BYTE_ORDER
+ #if defined(__OpenBSD__)
+ #include <endian.h>
+ #endif
#if ((defined(__LITTLE_ENDIAN__) && !defined(__BIG_ENDIAN__)) || \
- (defined(__BYTE_ORDER) && __BYTE_ORDER == __LITTLE_ENDIAN)) && \
+ (defined(__BYTE_ORDER) && __BYTE_ORDER == __LITTLE_ENDIAN) || \
+ (defined(BYTE_ORDER) && BYTE_ORDER == LITTLE_ENDIAN)) && \
!defined(PROTOBUF_DISABLE_LITTLE_ENDIAN_OPT_FOR_TEST)
#define PROTOBUF_LITTLE_ENDIAN 1
#endif