Commit 56c4f57b authored by Jisi Liu's avatar Jisi Liu

Merge branch 'gcc-c++11-fix' of https://github.com/nsuke/protobuf into beta-1

Manually merge pull request: https://github.com/google/protobuf/pull/674
that fixes the gcc C++11 build.
parents c3bc155a 99253172
......@@ -34,8 +34,8 @@
#include <google/protobuf/unittest.pb.h>
#include <google/protobuf/descriptor.h>
#include <gtest/gtest.h>
#include <google/protobuf/stubs/mathutil.h>
#include <gtest/gtest.h>
namespace google {
namespace protobuf {
......
......@@ -30,10 +30,6 @@
#include <google/protobuf/util/internal/utility.h>
#include <cmath>
#include <algorithm>
#include <utility>
#include <google/protobuf/stubs/common.h>
#include <google/protobuf/wrappers.pb.h>
#include <google/protobuf/descriptor.pb.h>
......@@ -301,8 +297,8 @@ bool IsMap(const google::protobuf::Field& field,
}
string DoubleAsString(double value) {
if (value == std::numeric_limits<double>::infinity()) return "Infinity";
if (value == -std::numeric_limits<double>::infinity()) return "-Infinity";
if (google::protobuf::MathLimits<double>::IsPosInf(value)) return "Infinity";
if (google::protobuf::MathLimits<double>::IsNegInf(value)) return "-Infinity";
if (google::protobuf::MathLimits<double>::IsNaN(value)) return "NaN";
return SimpleDtoa(value);
......@@ -320,8 +316,7 @@ bool SafeStrToFloat(StringPiece str, float *value) {
}
*value = static_cast<float>(double_value);
if ((*value == numeric_limits<float>::infinity()) ||
(*value == -numeric_limits<float>::infinity())) {
if (google::protobuf::MathLimits<float>::IsInf(*value)) {
return false;
}
return true;
......
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