Fix macros in header of generated code (#5881)

* Fix macros in header of generated code

* Define PROTOBUF_MIN_PROTOC_VERSION in port_def.inc
* Remove duplicated GOOGLE_PROTOBUF_MIN_LIBRARY_VERSION from common.h

* Send error if the error has been defined

* Undef the new macro
This commit is contained in:
Paul Yang 2019-03-15 11:17:23 -07:00 committed by GitHub
parent 4fd0579e47
commit 032a179e47
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 4 deletions

View File

@ -97,6 +97,9 @@
#ifdef PROTOBUF_MIN_HEADER_VERSION_FOR_PROTOC
#error PROTOBUF_MIN_HEADER_VERSION_FOR_PROTOC was previously defined
#endif
#ifdef PROTOBUF_MIN_PROTOC_VERSION
#error PROTOBUF_MIN_PROTOC_VERSION was previously defined
#endif
#ifdef PROTOBUF_PREDICT_TRUE
#error PROTOBUF_PREDICT_TRUE was previously defined
#endif
@ -257,6 +260,7 @@
#define PROTOBUF_VERSION 3007000
#define PROTOBUF_MIN_HEADER_VERSION_FOR_PROTOC 3007000
#define PROTOBUF_MIN_PROTOC_VERSION 3007000
#define PROTOBUF_VERSION_SUFFIX ""
// The minimum library version which works with the current version of the

View File

@ -50,6 +50,7 @@
#undef PROTOBUF_VERSION_SUFFIX
#undef PROTOBUF_FIELD_OFFSET
#undef PROTOBUF_MIN_HEADER_VERSION_FOR_PROTOC
#undef PROTOBUF_MIN_PROTOC_VERSION
#undef PROTOBUF_PREDICT_TRUE
#undef PROTOBUF_PREDICT_FALSE
#undef PROTOBUF_LONGLONG

View File

@ -86,10 +86,6 @@ namespace internal {
// A suffix string for alpha, beta or rc releases. Empty for stable releases.
#define GOOGLE_PROTOBUF_VERSION_SUFFIX ""
// The minimum library version which works with the current version of the
// headers.
#define GOOGLE_PROTOBUF_MIN_LIBRARY_VERSION 3007000
// The minimum header version which works with the current version of
// the library. This constant should only be used by protoc's C++ code
// generator.