aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFeng Xiao <xfxyjwf@gmail.com>2016-12-05 17:27:50 -0800
committerGitHub <noreply@github.com>2016-12-05 17:27:50 -0800
commit05090726144b6e632c50f47720ff51049bfcbef6 (patch)
treedb9e665c6757d26f13ef040da74a03e99c31f05f /src
parentc664b66808bd42b64eba193ecb38199934b85c85 (diff)
parent4cc160e1961a7abcd236b37c804774f7ef743eaa (diff)
downloadprotobuf-05090726144b6e632c50f47720ff51049bfcbef6.tar.gz
protobuf-05090726144b6e632c50f47720ff51049bfcbef6.tar.bz2
protobuf-05090726144b6e632c50f47720ff51049bfcbef6.zip
Merge pull request #2445 from ramrunner/master
OpenBSD correct endianess handling
Diffstat (limited to 'src')
-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