Commit 05090726 authored by Feng Xiao's avatar Feng Xiao Committed by GitHub

Merge pull request #2445 from ramrunner/master

OpenBSD correct endianess handling
parents c664b668 4cc160e1
...@@ -60,8 +60,12 @@ ...@@ -60,8 +60,12 @@
#endif #endif
#else #else
#include <sys/param.h> // __BYTE_ORDER #include <sys/param.h> // __BYTE_ORDER
#if defined(__OpenBSD__)
#include <endian.h>
#endif
#if ((defined(__LITTLE_ENDIAN__) && !defined(__BIG_ENDIAN__)) || \ #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) !defined(PROTOBUF_DISABLE_LITTLE_ENDIAN_OPT_FOR_TEST)
#define PROTOBUF_LITTLE_ENDIAN 1 #define PROTOBUF_LITTLE_ENDIAN 1
#endif #endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment