https://github.com/protocolbuffers/protobuf/issues/20299 --- protobuf-34.1/src/google/protobuf/os_macros_undef.inc.orig +++ protobuf-34.1/src/google/protobuf/os_macros_undef.inc @@ -158,6 +158,12 @@ #undef GID_MAX #endif // defined(__FreeBSD__) || defined(__OpenBSD__) +#ifdef __illumos__ +// Inconvenient macro name from /usr/include/limits.h. +#pragma push_macro("UID_MAX") +#undef UID_MAX +#endif // __illumos__ + #if defined(__clang__) || defined(__GNUC__) || defined(_MSC_VER) // Don't let Objective-C Macros interfere with proto identifiers with the same // name. --- protobuf-34.1/src/google/protobuf/os_macros_restore.inc.orig +++ protobuf-34.1/src/google/protobuf/os_macros_restore.inc @@ -92,6 +92,10 @@ #pragma pop_macro("GID_MAX") #endif // defined(__FreeBSD__) || defined(__OpenBSD__) +#ifdef __illumos__ +#pragma pop_macro("UID_MAX") +#endif // __illumos__ + #if defined(__clang__) || defined(__GNUC__) || defined(_MSC_VER) #pragma pop_macro("DEBUG") #endif // defined(__clang__) || defined(__GNUC__) || defined(_MSC_VER)