diff options
author | Feng Xiao <xfxyjwf@gmail.com> | 2014-12-20 17:43:04 -0800 |
---|---|---|
committer | Feng Xiao <xfxyjwf@gmail.com> | 2014-12-20 17:43:04 -0800 |
commit | bc3af606a7f5103dd49f9e5a8217bfefa04bc0d4 (patch) | |
tree | 486dead413de3ce8be8c654d27640b37ca5476b2 | |
parent | 59692c3fc080645fdc6e8d2445f04a1d65cee48c (diff) | |
parent | c3e928021f3817ac54973dc54fd6d91d292e55aa (diff) | |
download | protobuf-bc3af606a7f5103dd49f9e5a8217bfefa04bc0d4.tar.gz protobuf-bc3af606a7f5103dd49f9e5a8217bfefa04bc0d4.tar.bz2 protobuf-bc3af606a7f5103dd49f9e5a8217bfefa04bc0d4.zip |
Merge pull request #139 from c0nk/master
Improved little endian byte order detection
-rw-r--r-- | src/google/protobuf/io/coded_stream.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/google/protobuf/io/coded_stream.h b/src/google/protobuf/io/coded_stream.h index b9c30fa3..978cc19d 100644 --- a/src/google/protobuf/io/coded_stream.h +++ b/src/google/protobuf/io/coded_stream.h @@ -123,7 +123,8 @@ #endif #else #include <sys/param.h> // __BYTE_ORDER - #if defined(__BYTE_ORDER) && __BYTE_ORDER == __LITTLE_ENDIAN && \ + #if ((defined(__LITTLE_ENDIAN__) && !defined(__BIG_ENDIAN__)) || \ + (defined(__BYTE_ORDER) && __BYTE_ORDER == __LITTLE_ENDIAN)) && \ !defined(PROTOBUF_DISABLE_LITTLE_ENDIAN_OPT_FOR_TEST) #define PROTOBUF_LITTLE_ENDIAN 1 #endif |