mirror of
https://github.com/protobuf-c/protobuf-c.git
synced 2024-12-28 14:48:18 +08:00
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.
This commit is contained in:
parent
5c13d7dfe9
commit
e3acc96ca2
@ -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(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user