From 8e833bfc66f0b780c0f870d7b57372a31fb4130a Mon Sep 17 00:00:00 2001 From: Protobuf Team Bot Date: Tue, 5 Mar 2024 14:31:55 -0800 Subject: [PATCH] Fix missing port_def/port_undef includes PiperOrigin-RevId: 612971492 --- src/google/protobuf/any_lite.cc | 5 +++++ src/google/protobuf/arena_align.cc | 2 ++ src/google/protobuf/arena_allocation_policy.h | 2 ++ src/google/protobuf/arenaz_sampler.cc | 2 ++ src/google/protobuf/descriptor_database.cc | 5 +++++ src/google/protobuf/descriptor_legacy.h | 2 ++ src/google/protobuf/descriptor_lite.h | 2 ++ src/google/protobuf/descriptor_visitor.h | 2 ++ src/google/protobuf/extension_set_inl.h | 4 ++++ src/google/protobuf/field_access_listener.h | 4 ++++ src/google/protobuf/fully_verify_message_sets_opt_out.cc | 2 ++ src/google/protobuf/generated_enum_util.cc | 2 ++ src/google/protobuf/generated_message_tctable_full.cc | 2 ++ src/google/protobuf/generated_message_tctable_lite.cc | 2 ++ src/google/protobuf/inlined_string_field.cc | 2 ++ src/google/protobuf/internal_message_util.h | 4 ++++ src/google/protobuf/internal_visibility.h | 2 ++ src/google/protobuf/map_probe_benchmark.cc | 2 ++ src/google/protobuf/map_type_handler.h | 4 ++++ src/google/protobuf/metadata.h | 1 + src/google/protobuf/package_info.h | 1 + src/google/protobuf/port.cc | 2 ++ src/google/protobuf/raw_ptr.cc | 2 ++ src/google/protobuf/reflection_internal.h | 4 ++++ src/google/protobuf/reflection_mode.cc | 2 ++ src/google/protobuf/service.cc | 2 ++ 26 files changed, 66 insertions(+) diff --git a/src/google/protobuf/any_lite.cc b/src/google/protobuf/any_lite.cc index 0ea35922c2..82c983079e 100644 --- a/src/google/protobuf/any_lite.cc +++ b/src/google/protobuf/any_lite.cc @@ -12,6 +12,9 @@ #include "google/protobuf/generated_message_util.h" #include "google/protobuf/io/zero_copy_stream_impl_lite.h" +// Must be included last. +#include "google/protobuf/port_def.inc" + namespace google { namespace protobuf { namespace internal { @@ -72,3 +75,5 @@ bool ParseAnyTypeUrl(absl::string_view type_url, std::string* full_type_name) { } // namespace internal } // namespace protobuf } // namespace google + +#include "google/protobuf/port_undef.inc" diff --git a/src/google/protobuf/arena_align.cc b/src/google/protobuf/arena_align.cc index 9314873a1d..48c8471778 100644 --- a/src/google/protobuf/arena_align.cc +++ b/src/google/protobuf/arena_align.cc @@ -10,6 +10,8 @@ #include #include +// No port_def include needed + namespace google { namespace protobuf { namespace internal { diff --git a/src/google/protobuf/arena_allocation_policy.h b/src/google/protobuf/arena_allocation_policy.h index 0e9132d0e7..2c7b7f4f97 100644 --- a/src/google/protobuf/arena_allocation_policy.h +++ b/src/google/protobuf/arena_allocation_policy.h @@ -11,6 +11,8 @@ #include #include +// No port_def include needed + namespace google { namespace protobuf { namespace internal { diff --git a/src/google/protobuf/arenaz_sampler.cc b/src/google/protobuf/arenaz_sampler.cc index 11a3b0f7a4..7483ebe50b 100644 --- a/src/google/protobuf/arenaz_sampler.cc +++ b/src/google/protobuf/arenaz_sampler.cc @@ -221,3 +221,5 @@ void SetThreadSafeArenazGlobalNextSample(int64_t next_sample) {} } // namespace internal } // namespace protobuf } // namespace google + +#include "google/protobuf/port_undef.inc" diff --git a/src/google/protobuf/descriptor_database.cc b/src/google/protobuf/descriptor_database.cc index 9d6464f81b..cc2591c26a 100644 --- a/src/google/protobuf/descriptor_database.cc +++ b/src/google/protobuf/descriptor_database.cc @@ -24,6 +24,9 @@ #include "google/protobuf/descriptor.pb.h" +// Must be included last. +#include "google/protobuf/port_def.inc" + namespace google { namespace protobuf { @@ -1035,3 +1038,5 @@ bool MergedDescriptorDatabase::FindAllFileNames( } // namespace protobuf } // namespace google + +#include "google/protobuf/port_undef.inc" diff --git a/src/google/protobuf/descriptor_legacy.h b/src/google/protobuf/descriptor_legacy.h index 88a77b922d..92c3f5fa80 100644 --- a/src/google/protobuf/descriptor_legacy.h +++ b/src/google/protobuf/descriptor_legacy.h @@ -4,6 +4,8 @@ #include "google/protobuf/descriptor.pb.h" #include "google/protobuf/descriptor.h" +// No port_def include needed + namespace google { namespace protobuf { diff --git a/src/google/protobuf/descriptor_lite.h b/src/google/protobuf/descriptor_lite.h index db5805affe..e419b7a2f7 100644 --- a/src/google/protobuf/descriptor_lite.h +++ b/src/google/protobuf/descriptor_lite.h @@ -11,6 +11,8 @@ #ifndef GOOGLE_PROTOBUF_DESCRIPTOR_LITE_H__ #define GOOGLE_PROTOBUF_DESCRIPTOR_LITE_H__ +// No port_def include needed + namespace google { namespace protobuf { namespace internal { diff --git a/src/google/protobuf/descriptor_visitor.h b/src/google/protobuf/descriptor_visitor.h index fe71f23958..31a5ad010c 100644 --- a/src/google/protobuf/descriptor_visitor.h +++ b/src/google/protobuf/descriptor_visitor.h @@ -12,6 +12,8 @@ #include "google/protobuf/descriptor.pb.h" #include "google/protobuf/generated_message_reflection.h" +// No port_def include needed + namespace google { namespace protobuf { namespace internal { diff --git a/src/google/protobuf/extension_set_inl.h b/src/google/protobuf/extension_set_inl.h index 7360f181a3..e23a7b0379 100644 --- a/src/google/protobuf/extension_set_inl.h +++ b/src/google/protobuf/extension_set_inl.h @@ -12,6 +12,9 @@ #include "google/protobuf/metadata_lite.h" #include "google/protobuf/parse_context.h" +// Must be included last. +#include "google/protobuf/port_def.inc" + namespace google { namespace protobuf { namespace internal { @@ -259,5 +262,6 @@ const char* ExtensionSet::ParseMessageSetItemTmpl( } // namespace internal } // namespace protobuf } // namespace google +#include "google/protobuf/port_undef.inc" #endif // GOOGLE_PROTOBUF_EXTENSION_SET_INL_H__ diff --git a/src/google/protobuf/field_access_listener.h b/src/google/protobuf/field_access_listener.h index adfc3b6a2a..7603d03558 100644 --- a/src/google/protobuf/field_access_listener.h +++ b/src/google/protobuf/field_access_listener.h @@ -14,6 +14,9 @@ #include "google/protobuf/port.h" +// Must be included last. +#include "google/protobuf/port_def.inc" + namespace google { namespace protobuf { @@ -157,5 +160,6 @@ using AccessListener = NoOpAccessListener; // All hooks are subject to approval by protobuf-team@. #endif // !REPLACE_PROTO_LISTENER_IMPL +#include "google/protobuf/port_undef.inc" #endif // GOOGLE_PROTOBUF_FIELD_ACCESS_LISTENER_H__ diff --git a/src/google/protobuf/fully_verify_message_sets_opt_out.cc b/src/google/protobuf/fully_verify_message_sets_opt_out.cc index c2c53dadf1..e45aed3449 100644 --- a/src/google/protobuf/fully_verify_message_sets_opt_out.cc +++ b/src/google/protobuf/fully_verify_message_sets_opt_out.cc @@ -1,3 +1,5 @@ +// No port_def include needed + namespace google { namespace protobuf { namespace internal { diff --git a/src/google/protobuf/generated_enum_util.cc b/src/google/protobuf/generated_enum_util.cc index 372899e160..eb6b08fcb8 100644 --- a/src/google/protobuf/generated_enum_util.cc +++ b/src/google/protobuf/generated_enum_util.cc @@ -219,3 +219,5 @@ std::vector GenerateEnumData(absl::Span values) { } // namespace internal } // namespace protobuf } // namespace google + +#include "google/protobuf/port_undef.inc" diff --git a/src/google/protobuf/generated_message_tctable_full.cc b/src/google/protobuf/generated_message_tctable_full.cc index 75b86d8971..424bc84f05 100644 --- a/src/google/protobuf/generated_message_tctable_full.cc +++ b/src/google/protobuf/generated_message_tctable_full.cc @@ -100,3 +100,5 @@ const char* TcParser::MessageSetWireFormatParseLoop( } // namespace internal } // namespace protobuf } // namespace google + +#include "google/protobuf/port_undef.inc" diff --git a/src/google/protobuf/generated_message_tctable_lite.cc b/src/google/protobuf/generated_message_tctable_lite.cc index 53aabd01b8..c569219042 100644 --- a/src/google/protobuf/generated_message_tctable_lite.cc +++ b/src/google/protobuf/generated_message_tctable_lite.cc @@ -2957,3 +2957,5 @@ std::string TypeCardToString(uint16_t type_card) { } // namespace internal } // namespace protobuf } // namespace google + +#include "google/protobuf/port_undef.inc" diff --git a/src/google/protobuf/inlined_string_field.cc b/src/google/protobuf/inlined_string_field.cc index ec0a9de10f..a17f922b6c 100644 --- a/src/google/protobuf/inlined_string_field.cc +++ b/src/google/protobuf/inlined_string_field.cc @@ -116,3 +116,5 @@ void InlinedStringField::ClearToDefault(const LazyString& default_value, } // namespace internal } // namespace protobuf } // namespace google + +#include "google/protobuf/port_undef.inc" diff --git a/src/google/protobuf/internal_message_util.h b/src/google/protobuf/internal_message_util.h index 6233da4766..be9d82c4da 100644 --- a/src/google/protobuf/internal_message_util.h +++ b/src/google/protobuf/internal_message_util.h @@ -13,6 +13,9 @@ #include "google/protobuf/message.h" +// Must be included last. +#include "google/protobuf/port_def.inc" + namespace google { namespace protobuf { namespace internal { @@ -21,5 +24,6 @@ namespace internal { } // namespace internal } // namespace protobuf } // namespace google +#include "google/protobuf/port_undef.inc" #endif // GOOGLE_PROTOBUF_INTERNAL_MESSAGE_UTIL_H__ diff --git a/src/google/protobuf/internal_visibility.h b/src/google/protobuf/internal_visibility.h index fed45bd944..154d06b572 100644 --- a/src/google/protobuf/internal_visibility.h +++ b/src/google/protobuf/internal_visibility.h @@ -7,6 +7,8 @@ #ifndef GOOGLE_PROTOBUF_INTERNAL_VISIBILITY_H__ #define GOOGLE_PROTOBUF_INTERNAL_VISIBILITY_H__ +// No port_def include needed + namespace google { namespace protobuf { diff --git a/src/google/protobuf/map_probe_benchmark.cc b/src/google/protobuf/map_probe_benchmark.cc index 550de51a4e..1eac88c319 100644 --- a/src/google/protobuf/map_probe_benchmark.cc +++ b/src/google/protobuf/map_probe_benchmark.cc @@ -18,6 +18,8 @@ #include "absl/strings/string_view.h" #include "google/protobuf/map.h" +// No port_def include needed + namespace google::protobuf::internal { struct MapBenchmarkPeer { template diff --git a/src/google/protobuf/map_type_handler.h b/src/google/protobuf/map_type_handler.h index 5fdb4ed8ab..4e04e4d375 100644 --- a/src/google/protobuf/map_type_handler.h +++ b/src/google/protobuf/map_type_handler.h @@ -17,6 +17,9 @@ #include "google/protobuf/parse_context.h" #include "google/protobuf/wire_format_lite.h" +// Must be included last. +#include "google/protobuf/port_def.inc" + #ifdef SWIG #error "You cannot SWIG proto headers" #endif @@ -373,5 +376,6 @@ struct MapEntryFuncs { } // namespace internal } // namespace protobuf } // namespace google +#include "google/protobuf/port_undef.inc" #endif // GOOGLE_PROTOBUF_MAP_TYPE_HANDLER_H__ diff --git a/src/google/protobuf/metadata.h b/src/google/protobuf/metadata.h index b04f3b955a..d8e4d488d2 100644 --- a/src/google/protobuf/metadata.h +++ b/src/google/protobuf/metadata.h @@ -8,6 +8,7 @@ #ifndef GOOGLE_PROTOBUF_METADATA_H__ #define GOOGLE_PROTOBUF_METADATA_H__ +// No port_def include needed // TODO: Remove this file and all instances where it gets imported. #endif // GOOGLE_PROTOBUF_METADATA_H__ diff --git a/src/google/protobuf/package_info.h b/src/google/protobuf/package_info.h index ab2c074601..5388241f12 100644 --- a/src/google/protobuf/package_info.h +++ b/src/google/protobuf/package_info.h @@ -41,3 +41,4 @@ namespace protobuf { // from combining the brackets. Which would mess with extract script } // namespace protobuf } // namespace google +// No port_def include needed diff --git a/src/google/protobuf/port.cc b/src/google/protobuf/port.cc index 30356f94f2..5308f37177 100644 --- a/src/google/protobuf/port.cc +++ b/src/google/protobuf/port.cc @@ -27,3 +27,5 @@ void protobuf_assumption_failed(const char* pred, const char* file, int line) { } // namespace internal } // namespace protobuf } // namespace google + +#include "google/protobuf/port_undef.inc" diff --git a/src/google/protobuf/raw_ptr.cc b/src/google/protobuf/raw_ptr.cc index 01f4c36558..cffe79c502 100644 --- a/src/google/protobuf/raw_ptr.cc +++ b/src/google/protobuf/raw_ptr.cc @@ -23,3 +23,5 @@ ABSL_CONST_INIT PROTOBUF_EXPORT } // namespace internal } // namespace protobuf } // namespace google + +#include "google/protobuf/port_undef.inc" diff --git a/src/google/protobuf/reflection_internal.h b/src/google/protobuf/reflection_internal.h index ea4bac293a..5e08ba6d68 100644 --- a/src/google/protobuf/reflection_internal.h +++ b/src/google/protobuf/reflection_internal.h @@ -13,6 +13,9 @@ #include "google/protobuf/reflection.h" #include "google/protobuf/repeated_field.h" +// Must be included last. +#include "google/protobuf/port_def.inc" + namespace google { namespace protobuf { namespace internal { @@ -347,5 +350,6 @@ class RepeatedPtrFieldMessageAccessor final } // namespace internal } // namespace protobuf } // namespace google +#include "google/protobuf/port_undef.inc" #endif // GOOGLE_PROTOBUF_REFLECTION_INTERNAL_H__ diff --git a/src/google/protobuf/reflection_mode.cc b/src/google/protobuf/reflection_mode.cc index c81728a166..13a0bf0a13 100644 --- a/src/google/protobuf/reflection_mode.cc +++ b/src/google/protobuf/reflection_mode.cc @@ -32,3 +32,5 @@ PROTOBUF_CONSTINIT PROTOBUF_THREAD_LOCAL ReflectionMode } // namespace internal } // namespace protobuf } // namespace google + +#include "google/protobuf/port_undef.inc" diff --git a/src/google/protobuf/service.cc b/src/google/protobuf/service.cc index 7273a68b03..850efc4d81 100644 --- a/src/google/protobuf/service.cc +++ b/src/google/protobuf/service.cc @@ -11,6 +11,8 @@ #include "google/protobuf/service.h" +// No port_def include needed + namespace google { namespace protobuf {