Fix the macro PROTOBUF_LITTLE_ENDIAN cannot be set correctly on the little endian QNX. (#11750)

Fix the macro PROTOBUF_LITTLE_ENDIAN cannot be set correctly on the little endian QNX.

Signed-off-by: wugaoyin <1132954336@qq.com>

Closes #11750

COPYBARA_INTEGRATE_REVIEW=https://github.com/protocolbuffers/protobuf/pull/11750 from WuGaoyin:main 09ec1a19e9
PiperOrigin-RevId: 506979012
pull/11805/head
WuGaoyin 2 years ago committed by Matt Kulukundis
parent 9914d2ed06
commit 518cda206b
  1. 4
      src/google/protobuf/stubs/port.h

@ -67,11 +67,11 @@
#include <sys/isa_defs.h> // __BYTE_ORDER
#elif defined(_AIX) || defined(__TOS_AIX__)
#include <sys/machine.h> // BYTE_ORDER
#elif defined(__QNX__)
#include <sys/param.h> // BYTE_ORDER
#else
#if !defined(__QNX__)
#include <endian.h> // __BYTE_ORDER
#endif
#endif
#if ((defined(__LITTLE_ENDIAN__) && !defined(__BIG_ENDIAN__)) || \
(defined(__BYTE_ORDER) && __BYTE_ORDER == __LITTLE_ENDIAN) || \
(defined(BYTE_ORDER) && BYTE_ORDER == LITTLE_ENDIAN)) && \

Loading…
Cancel
Save