Explorar o código

Merge pull request #139 from c0nk/master

Improved little endian byte order detection
Feng Xiao %!s(int64=10) %!d(string=hai) anos
pai
achega
bc3af606a7
Modificáronse 1 ficheiros con 2 adicións e 1 borrados
  1. 2 1
      src/google/protobuf/io/coded_stream.h

+ 2 - 1
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