diff options
Diffstat (limited to 'src/google/protobuf/compiler/java/java_helpers.cc')
-rw-r--r-- | src/google/protobuf/compiler/java/java_helpers.cc | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/google/protobuf/compiler/java/java_helpers.cc b/src/google/protobuf/compiler/java/java_helpers.cc index c31df265..efb5fd45 100644 --- a/src/google/protobuf/compiler/java/java_helpers.cc +++ b/src/google/protobuf/compiler/java/java_helpers.cc @@ -360,6 +360,7 @@ const char* BoxedPrimitiveTypeName(JavaType type) { return NULL; } + const char* FieldTypeName(FieldDescriptor::Type field_type) { switch (field_type) { case FieldDescriptor::TYPE_INT32 : return "INT32"; @@ -415,9 +416,9 @@ string DefaultValue(const FieldDescriptor* field, bool immutable, "L"; case FieldDescriptor::CPPTYPE_DOUBLE: { double value = field->default_value_double(); - if (value == numeric_limits<double>::infinity()) { + if (value == std::numeric_limits<double>::infinity()) { return "Double.POSITIVE_INFINITY"; - } else if (value == -numeric_limits<double>::infinity()) { + } else if (value == -std::numeric_limits<double>::infinity()) { return "Double.NEGATIVE_INFINITY"; } else if (value != value) { return "Double.NaN"; @@ -427,9 +428,9 @@ string DefaultValue(const FieldDescriptor* field, bool immutable, } case FieldDescriptor::CPPTYPE_FLOAT: { float value = field->default_value_float(); - if (value == numeric_limits<float>::infinity()) { + if (value == std::numeric_limits<float>::infinity()) { return "Float.POSITIVE_INFINITY"; - } else if (value == -numeric_limits<float>::infinity()) { + } else if (value == -std::numeric_limits<float>::infinity()) { return "Float.NEGATIVE_INFINITY"; } else if (value != value) { return "Float.NaN"; |