Commit 53c10293 authored by Feng Xiao's avatar Feng Xiao

Merge pull request #84 from tseaver/fix_80-avoid_INT32_MAX_MIN

Don't rely on non-standard 'INT32_MAX' / 'INT32_MIN'.
parents f157a565 8b2aafe7
......@@ -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_ = INT32_MIN,\n"
"$classname$_$prefix$INT_MAX_SENTINEL_DO_NOT_USE_ = INT32_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();
......
......@@ -105,7 +105,6 @@ void FileGenerator::GenerateHeader(io::Printer* printer) {
"#define PROTOBUF_$filename_identifier$__INCLUDED\n"
"\n"
"#include <string>\n"
"#include <stdint.h>\n" // INT32_MIN, INT32_MAX
"\n",
"filename", file_->name(),
"filename_identifier", filename_identifier);
......
......@@ -5,7 +5,6 @@
#define PROTOBUF_google_2fprotobuf_2fcompiler_2fplugin_2eproto__INCLUDED
#include <string>
#include <stdint.h>
#include <google/protobuf/stubs/common.h>
......
......@@ -5,7 +5,6 @@
#define PROTOBUF_google_2fprotobuf_2fdescriptor_2eproto__INCLUDED
#include <string>
#include <stdint.h>
#include <google/protobuf/stubs/common.h>
......
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