diff --git a/src/google/protobuf/descriptor.proto b/src/google/protobuf/descriptor.proto index 513b3b6f81..171ac57c79 100644 --- a/src/google/protobuf/descriptor.proto +++ b/src/google/protobuf/descriptor.proto @@ -724,6 +724,7 @@ message FieldOptions { } message OneofOptions { + // The parser stores options it doesn't recognize here. See above. repeated UninterpretedOption uninterpreted_option = 999; diff --git a/src/google/protobuf/port_def.inc b/src/google/protobuf/port_def.inc index 0862c9533e..91a01573fa 100644 --- a/src/google/protobuf/port_def.inc +++ b/src/google/protobuf/port_def.inc @@ -877,6 +877,13 @@ static_assert(PROTOBUF_CPLUSPLUS_MIN(201402L), "Protobuf only supports C++14 and #undef PACKAGE #endif +// a few common headers define this +#ifdef PACKED +#define PROTOBUF_DID_UNDEF_PACKED +#pragma push_macro("PACKED") +#undef PACKED +#endif + // linux is a legacy MACRO defined in most popular C++ standards. #ifdef linux #pragma push_macro("linux") diff --git a/src/google/protobuf/port_undef.inc b/src/google/protobuf/port_undef.inc index 03b216c422..d56614765e 100644 --- a/src/google/protobuf/port_undef.inc +++ b/src/google/protobuf/port_undef.inc @@ -127,6 +127,11 @@ #undef PROTOBUF_DID_UNDEF_PACKAGE #endif +#ifdef PROTOBUF_DID_UNDEF_PACKED +#pragma pop_macro("PACKED") +#undef PROTOBUF_DID_UNDEF_PACKED +#endif + #ifdef PROTOBUF_DID_UNDEF_LINUX #pragma pop_macro("linux") #endif