diff options
author | Tres Seaver <tseaver@palladion.com> | 2014-11-17 19:35:04 -0500 |
---|---|---|
committer | Tres Seaver <tseaver@palladion.com> | 2014-11-17 19:35:04 -0500 |
commit | 8b2aafe7d3f59463fb8693421c09bfefb3bd0104 (patch) | |
tree | 803aec712c672d78cf930889977df651269d33d7 /src/google/protobuf/compiler/cpp | |
parent | 83671c0514741a64433dd86a958e3df6bf9508c6 (diff) | |
download | protobuf-8b2aafe7d3f59463fb8693421c09bfefb3bd0104.tar.gz protobuf-8b2aafe7d3f59463fb8693421c09bfefb3bd0104.tar.bz2 protobuf-8b2aafe7d3f59463fb8693421c09bfefb3bd0104.zip |
Use 'kint32min'/'kint32max' constants, rather than defining locally.
Incorporates feedback from @xfxyjwf:
https://github.com/google/protobuf/pull/84#discussion_r20474781.
Diffstat (limited to 'src/google/protobuf/compiler/cpp')
-rw-r--r-- | src/google/protobuf/compiler/cpp/cpp_enum.cc | 4 | ||||
-rw-r--r-- | src/google/protobuf/compiler/cpp/cpp_file.cc | 6 |
2 files changed, 2 insertions, 8 deletions
diff --git a/src/google/protobuf/compiler/cpp/cpp_enum.cc b/src/google/protobuf/compiler/cpp/cpp_enum.cc index 769ea678..3ce1f120 100644 --- a/src/google/protobuf/compiler/cpp/cpp_enum.cc +++ b/src/google/protobuf/compiler/cpp/cpp_enum.cc @@ -106,8 +106,8 @@ void EnumGenerator::GenerateDefinition(io::Printer* printer) { // INT32_MIN and INT32_MAX if (descriptor_->value_count() > 0) printer->Print(",\n"); printer->Print(vars, - "$classname$_$prefix$INT_MIN_SENTINEL_DO_NOT_USE_ = PROTOBUF_ENUM_MIN,\n" - "$classname$_$prefix$INT_MAX_SENTINEL_DO_NOT_USE_ = PROTOBUF_ENUM_MAX"); + "$classname$_$prefix$INT_MIN_SENTINEL_DO_NOT_USE_ = ::google::protobuf::kint32min,\n" + "$classname$_$prefix$INT_MAX_SENTINEL_DO_NOT_USE_ = ::google::protobuf::kint32max"); } printer->Outdent(); diff --git a/src/google/protobuf/compiler/cpp/cpp_file.cc b/src/google/protobuf/compiler/cpp/cpp_file.cc index 6b265dc6..6dc88e88 100644 --- a/src/google/protobuf/compiler/cpp/cpp_file.cc +++ b/src/google/protobuf/compiler/cpp/cpp_file.cc @@ -105,12 +105,6 @@ void FileGenerator::GenerateHeader(io::Printer* printer) { "#define PROTOBUF_$filename_identifier$__INCLUDED\n" "\n" "#include <string>\n" - "#ifndef PROTOBUF_ENUM_MIN\n" - "#define PROTOBUF_ENUM_MIN (int32_t)0x80000000\n" - "#endif\n" - "#ifndef PROTOBUF_ENUM_MAX\n" - "#define PROTOBUF_ENUM_MAX (int32_t)0x7fffffff\n" - "#endif\n" "\n", "filename", file_->name(), "filename_identifier", filename_identifier); |