Skip to content

Commit

Permalink
Fix build on AIX and SunOS (#8373) (#9065)
Browse files Browse the repository at this point in the history
* fix includes for AIX and SunOS
  • Loading branch information
scddev committed Oct 11, 2021
1 parent 1b22582 commit 3bdcc12
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/google/protobuf/io/coded_stream.h
Expand Up @@ -136,6 +136,10 @@
#include <machine/endian.h> // __BYTE_ORDER
#elif defined(__FreeBSD__)
#include <sys/endian.h> // __BYTE_ORDER
#elif (defined(sun) || defined(__sun)) && (defined(__SVR4) || defined(__svr4__))
#include <sys/isa_defs.h> // __BYTE_ORDER
#elif defined(_AIX) || defined(__TOS_AIX__)
#include <sys/machine.h> // BYTE_ORDER
#else
#if !defined(__QNX__)
#include <endian.h> // __BYTE_ORDER
Expand Down
2 changes: 1 addition & 1 deletion src/google/protobuf/port_def.inc
Expand Up @@ -607,7 +607,7 @@
#ifdef PROTOBUF_ATTRIBUTE_INIT_PRIORITY
#error PROTOBUF_ATTRIBUTE_INIT_PRIORITY was previously defined
#endif
#if PROTOBUF_GNUC_MIN(3, 0) && (!defined(__APPLE__) || defined(__clang__))
#if PROTOBUF_GNUC_MIN(3, 0) && (!defined(__APPLE__) || defined(__clang__)) && !((defined(sun) || defined(__sun)) && (defined(__SVR4) || defined(__svr4__)))
#define PROTOBUF_ATTRIBUTE_INIT_PRIORITY __attribute__((init_priority((102))))
#else
#define PROTOBUF_ATTRIBUTE_INIT_PRIORITY
Expand Down
4 changes: 4 additions & 0 deletions src/google/protobuf/stubs/port.h
Expand Up @@ -61,6 +61,10 @@
#include <machine/endian.h> // __BYTE_ORDER
#elif defined(__FreeBSD__)
#include <sys/endian.h> // __BYTE_ORDER
#elif (defined(sun) || defined(__sun)) && (defined(__SVR4) || defined(__svr4__))
#include <sys/isa_defs.h> // __BYTE_ORDER
#elif defined(_AIX) || defined(__TOS_AIX__)
#include <sys/machine.h> // BYTE_ORDER
#else
#if !defined(__QNX__)
#include <endian.h> // __BYTE_ORDER
Expand Down

0 comments on commit 3bdcc12

Please sign in to comment.