Skip to content

Commit

Permalink
Add extension declarations for known features.
Browse files Browse the repository at this point in the history
This will prevent users from accidentally overriding these with different types (e.g. #16757 and #16756).

PiperOrigin-RevId: 631518986
  • Loading branch information
mkruskal-google committed May 13, 2024
1 parent 3bc8667 commit f8d0a5b
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 42 deletions.
74 changes: 37 additions & 37 deletions src/google/protobuf/descriptor.pb.cc

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 18 additions & 5 deletions src/google/protobuf/descriptor.proto
Original file line number Diff line number Diff line change
Expand Up @@ -1066,11 +1066,24 @@ message FeatureSet {

reserved 999;

extensions 1000; // for Protobuf C++
extensions 1001; // for Protobuf Java
extensions 1002; // for Protobuf Go

extensions 9990; // for deprecated Java Proto1
extensions 1000 to 9994 [
declaration = {
number: 1000,
full_name: ".pb.cpp",
type: ".pb.CppFeatures"
},
declaration = {
number: 1001,
full_name: ".pb.java",
type: ".pb.JavaFeatures"
},
declaration = { number: 1002, full_name: ".pb.go", type: ".pb.GoFeatures" },
declaration = {
number: 9990,
full_name: ".pb.proto1",
type: ".pb.Proto1Features"
}
];

extensions 9995 to 9999; // For internal testing
extensions 10000; // for https://github.com/bufbuild/protobuf-es
Expand Down

0 comments on commit f8d0a5b

Please sign in to comment.