Skip to content

Commit 032a179

Browse files
authored
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
1 parent 4fd0579 commit 032a179

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

src/google/protobuf/port_def.inc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,9 @@
9797
#ifdef PROTOBUF_MIN_HEADER_VERSION_FOR_PROTOC
9898
#error PROTOBUF_MIN_HEADER_VERSION_FOR_PROTOC was previously defined
9999
#endif
100+
#ifdef PROTOBUF_MIN_PROTOC_VERSION
101+
#error PROTOBUF_MIN_PROTOC_VERSION was previously defined
102+
#endif
100103
#ifdef PROTOBUF_PREDICT_TRUE
101104
#error PROTOBUF_PREDICT_TRUE was previously defined
102105
#endif
@@ -257,6 +260,7 @@
257260

258261
#define PROTOBUF_VERSION 3007000
259262
#define PROTOBUF_MIN_HEADER_VERSION_FOR_PROTOC 3007000
263+
#define PROTOBUF_MIN_PROTOC_VERSION 3007000
260264
#define PROTOBUF_VERSION_SUFFIX ""
261265

262266
// The minimum library version which works with the current version of the

src/google/protobuf/port_undef.inc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
#undef PROTOBUF_VERSION_SUFFIX
5151
#undef PROTOBUF_FIELD_OFFSET
5252
#undef PROTOBUF_MIN_HEADER_VERSION_FOR_PROTOC
53+
#undef PROTOBUF_MIN_PROTOC_VERSION
5354
#undef PROTOBUF_PREDICT_TRUE
5455
#undef PROTOBUF_PREDICT_FALSE
5556
#undef PROTOBUF_LONGLONG

src/google/protobuf/stubs/common.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,6 @@ namespace internal {
8686
// A suffix string for alpha, beta or rc releases. Empty for stable releases.
8787
#define GOOGLE_PROTOBUF_VERSION_SUFFIX ""
8888

89-
// The minimum library version which works with the current version of the
90-
// headers.
91-
#define GOOGLE_PROTOBUF_MIN_LIBRARY_VERSION 3007000
92-
9389
// The minimum header version which works with the current version of
9490
// the library. This constant should only be used by protoc's C++ code
9591
// generator.

0 commit comments

Comments
 (0)