diff --git a/editions/golden/compare_cpp_codegen_failure.xml b/editions/golden/compare_cpp_codegen_failure.xml index c3050bb21f..306f72136a 100644 --- a/editions/golden/compare_cpp_codegen_failure.xml +++ b/editions/golden/compare_cpp_codegen_failure.xml @@ -5,7 +5,7 @@ - + diff --git a/src/google/protobuf/compiler/cpp/helpers.h b/src/google/protobuf/compiler/cpp/helpers.h index 95c2b6b953..f0e766f434 100644 --- a/src/google/protobuf/compiler/cpp/helpers.h +++ b/src/google/protobuf/compiler/cpp/helpers.h @@ -50,11 +50,6 @@ inline absl::string_view ProtobufNamespace(const Options& opts) { return opts.opensource_runtime ? kOssNs : kGoogle3Ns; } -inline std::string MacroPrefix(const Options& options) { - // Constants are different in the internal and external version. - return options.opensource_runtime ? "GOOGLE_PROTOBUF" : "GOOGLE_PROTOBUF"; -} - inline std::string DeprecatedAttribute(const Options&, const FieldDescriptor* d) { return d->options().deprecated() ? "[[deprecated]] " : ""; @@ -582,25 +577,7 @@ inline std::string IncludeGuard(const FileDescriptor* file, case GeneratedFileType::kProtoStaticReflectionH: extension = ".proto.static_reflection.h"; } - std::string filename_identifier = - FilenameIdentifier(absl::StrCat(file->name(), extension)); - - if (IsWellKnownMessage(file)) { - // For well-known messages we need third_party/protobuf and net/proto2 to - // have distinct include guards, because some source files include both and - // both need to be defined (the third_party copies will be in the - // google::protobuf_opensource namespace). - return absl::StrCat(MacroPrefix(options), "_INCLUDED_", - filename_identifier); - } else { - // Ideally this case would use distinct include guards for opensource and - // google3 protos also. (The behavior of "first #included wins" is not - // ideal). But unfortunately some legacy code includes both and depends on - // the identical include guards to avoid compile errors. - // - // We should clean this up so that this case can be removed. - return absl::StrCat("GOOGLE_PROTOBUF_INCLUDED_", filename_identifier); - } + return FilenameIdentifier(absl::StrCat(file->name(), extension)); } // Returns the OptimizeMode for this file, furthermore it updates a status diff --git a/src/google/protobuf/compiler/java/java_features.pb.h b/src/google/protobuf/compiler/java/java_features.pb.h index 9c21c13fc8..707a65f692 100644 --- a/src/google/protobuf/compiler/java/java_features.pb.h +++ b/src/google/protobuf/compiler/java/java_features.pb.h @@ -3,8 +3,8 @@ // source: google/protobuf/compiler/java/java_features.proto // Protobuf C++ Version: 5.29.0-dev -#ifndef GOOGLE_PROTOBUF_INCLUDED_google_2fprotobuf_2fcompiler_2fjava_2fjava_5ffeatures_2eproto_2epb_2eh -#define GOOGLE_PROTOBUF_INCLUDED_google_2fprotobuf_2fcompiler_2fjava_2fjava_5ffeatures_2eproto_2epb_2eh +#ifndef google_2fprotobuf_2fcompiler_2fjava_2fjava_5ffeatures_2eproto_2epb_2eh +#define google_2fprotobuf_2fcompiler_2fjava_2fjava_5ffeatures_2eproto_2epb_2eh #include #include @@ -428,4 +428,4 @@ inline const EnumDescriptor* GetEnumDescriptor<::pb::JavaFeatures_Utf8Validation #include "google/protobuf/port_undef.inc" -#endif // GOOGLE_PROTOBUF_INCLUDED_google_2fprotobuf_2fcompiler_2fjava_2fjava_5ffeatures_2eproto_2epb_2eh +#endif // google_2fprotobuf_2fcompiler_2fjava_2fjava_5ffeatures_2eproto_2epb_2eh diff --git a/src/google/protobuf/compiler/plugin.pb.h b/src/google/protobuf/compiler/plugin.pb.h index c476ca4e92..b6ab93d9bb 100644 --- a/src/google/protobuf/compiler/plugin.pb.h +++ b/src/google/protobuf/compiler/plugin.pb.h @@ -3,8 +3,8 @@ // source: google/protobuf/compiler/plugin.proto // Protobuf C++ Version: 5.29.0-dev -#ifndef GOOGLE_PROTOBUF_INCLUDED_google_2fprotobuf_2fcompiler_2fplugin_2eproto_2epb_2eh -#define GOOGLE_PROTOBUF_INCLUDED_google_2fprotobuf_2fcompiler_2fplugin_2eproto_2epb_2eh +#ifndef google_2fprotobuf_2fcompiler_2fplugin_2eproto_2epb_2eh +#define google_2fprotobuf_2fcompiler_2fplugin_2eproto_2epb_2eh #include #include @@ -2211,4 +2211,4 @@ inline const EnumDescriptor* GetEnumDescriptor<::google::protobuf::compiler::Cod #include "google/protobuf/port_undef.inc" -#endif // GOOGLE_PROTOBUF_INCLUDED_google_2fprotobuf_2fcompiler_2fplugin_2eproto_2epb_2eh +#endif // google_2fprotobuf_2fcompiler_2fplugin_2eproto_2epb_2eh diff --git a/src/google/protobuf/cpp_features.pb.h b/src/google/protobuf/cpp_features.pb.h index 6f96cc61cd..de4cc6be47 100644 --- a/src/google/protobuf/cpp_features.pb.h +++ b/src/google/protobuf/cpp_features.pb.h @@ -3,8 +3,8 @@ // source: google/protobuf/cpp_features.proto // Protobuf C++ Version: 5.29.0-dev -#ifndef GOOGLE_PROTOBUF_INCLUDED_google_2fprotobuf_2fcpp_5ffeatures_2eproto_2epb_2eh -#define GOOGLE_PROTOBUF_INCLUDED_google_2fprotobuf_2fcpp_5ffeatures_2eproto_2epb_2eh +#ifndef google_2fprotobuf_2fcpp_5ffeatures_2eproto_2epb_2eh +#define google_2fprotobuf_2fcpp_5ffeatures_2eproto_2epb_2eh #include #include @@ -471,4 +471,4 @@ inline const EnumDescriptor* GetEnumDescriptor<::pb::CppFeatures_StringType>() { #include "google/protobuf/port_undef.inc" -#endif // GOOGLE_PROTOBUF_INCLUDED_google_2fprotobuf_2fcpp_5ffeatures_2eproto_2epb_2eh +#endif // google_2fprotobuf_2fcpp_5ffeatures_2eproto_2epb_2eh diff --git a/src/google/protobuf/descriptor.pb.h b/src/google/protobuf/descriptor.pb.h index 5605921c35..723f20db29 100644 --- a/src/google/protobuf/descriptor.pb.h +++ b/src/google/protobuf/descriptor.pb.h @@ -3,8 +3,8 @@ // source: google/protobuf/descriptor.proto // Protobuf C++ Version: 5.29.0-dev -#ifndef GOOGLE_PROTOBUF_INCLUDED_google_2fprotobuf_2fdescriptor_2eproto_2epb_2eh -#define GOOGLE_PROTOBUF_INCLUDED_google_2fprotobuf_2fdescriptor_2eproto_2epb_2eh +#ifndef google_2fprotobuf_2fdescriptor_2eproto_2epb_2eh +#define google_2fprotobuf_2fdescriptor_2eproto_2epb_2eh #include #include @@ -20819,4 +20819,4 @@ inline const EnumDescriptor* GetEnumDescriptor<::google::protobuf::Edition>() { #include "google/protobuf/port_undef.inc" -#endif // GOOGLE_PROTOBUF_INCLUDED_google_2fprotobuf_2fdescriptor_2eproto_2epb_2eh +#endif // google_2fprotobuf_2fdescriptor_2eproto_2epb_2eh