From 7dbe742e6c4bea916c54713e31811412d2076351 Mon Sep 17 00:00:00 2001 From: Sandy Zhang Date: Tue, 25 Apr 2023 14:31:44 -0700 Subject: [PATCH] Internal protobuf changes PiperOrigin-RevId: 527076622 --- src/google/protobuf/descriptor.proto | 1 + src/google/protobuf/port_def.inc | 7 +++++++ src/google/protobuf/port_undef.inc | 5 +++++ 3 files changed, 13 insertions(+) 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