diff --git a/src/google/protobuf/io/coded_stream.h b/src/google/protobuf/io/coded_stream.h index 0fff1782cf07..a4d5f960a338 100644 --- a/src/google/protobuf/io/coded_stream.h +++ b/src/google/protobuf/io/coded_stream.h @@ -131,7 +131,11 @@ #pragma runtime_checks("c", off) #endif #else -#include // __BYTE_ORDER +#ifdef __APPLE__ +#include // __BYTE_ORDER +#else +#include // __BYTE_ORDER +#endif #if ((defined(__LITTLE_ENDIAN__) && !defined(__BIG_ENDIAN__)) || \ (defined(__BYTE_ORDER) && __BYTE_ORDER == __LITTLE_ENDIAN)) && \ !defined(PROTOBUF_DISABLE_LITTLE_ENDIAN_OPT_FOR_TEST) diff --git a/src/google/protobuf/stubs/port.h b/src/google/protobuf/stubs/port.h index db8b62f6b3a4..120ab7e9f427 100644 --- a/src/google/protobuf/stubs/port.h +++ b/src/google/protobuf/stubs/port.h @@ -57,9 +57,10 @@ #pragma runtime_checks("c", off) #endif #else - #include // __BYTE_ORDER - #if defined(__OpenBSD__) - #include + #ifdef __APPLE__ + #include // __BYTE_ORDER + #else + #include // __BYTE_ORDER #endif #if ((defined(__LITTLE_ENDIAN__) && !defined(__BIG_ENDIAN__)) || \ (defined(__BYTE_ORDER) && __BYTE_ORDER == __LITTLE_ENDIAN) || \