Commit a6cf1aa3 authored by Robert Edmonds's avatar Robert Edmonds

FileGenerator::GenerateHeader(): Set `min_header_version` unconditionally

Previously, we were conditionally trying to set `min_header_version` to
the lowest possible value, and relying on a "legacy" Google interface to
determine the file descriptor's syntax version as part of that
determination.

Instead, simply bump the minimum version to 1003000 (1.3.0). This
release was almost 7 years ago. In practice protobuf-c users should not
be shipping pre-compiled .pb-c.c/.pb-c.h files, anyway.
parent e05528c8
...@@ -117,14 +117,7 @@ FileGenerator::~FileGenerator() {} ...@@ -117,14 +117,7 @@ FileGenerator::~FileGenerator() {}
void FileGenerator::GenerateHeader(io::Printer* printer) { void FileGenerator::GenerateHeader(io::Printer* printer) {
std::string filename_identifier = FilenameIdentifier(file_->name()); std::string filename_identifier = FilenameIdentifier(file_->name());
int min_header_version = 1000000; const int min_header_version = 1003000;
#if GOOGLE_PROTOBUF_VERSION >= 4023000
if (FileDescriptorLegacy(file_).syntax() == FileDescriptorLegacy::SYNTAX_PROTO3) {
#else
if (file_->syntax() == FileDescriptor::SYNTAX_PROTO3) {
#endif
min_header_version = 1003000;
}
// Generate top of header. // Generate top of header.
printer->Print( printer->Print(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment