Index: base/json/json_writer.cc |
diff --git a/base/json/json_writer.cc b/base/json/json_writer.cc |
index abfead80070d4354f878c6a8419f6e4a315d2e26..2d3ae0fa855d863d6145947f3a23d911888806ef 100644 |
--- a/base/json/json_writer.cc |
+++ b/base/json/json_writer.cc |
@@ -4,7 +4,10 @@ |
#include "base/json/json_writer.h" |
+#include <stdint.h> |
+ |
#include <cmath> |
+#include <limits> |
#include "base/json/string_escape.h" |
#include "base/logging.h" |
@@ -79,10 +82,10 @@ bool JSONWriter::BuildJSONString(const Value& node, size_t depth) { |
bool result = node.GetAsDouble(&value); |
DCHECK(result); |
if (omit_double_type_preservation_ && |
- value <= kint64max && |
- value >= kint64min && |
+ value <= std::numeric_limits<int64_t>::max() && |
+ value >= std::numeric_limits<int64_t>::min() && |
std::floor(value) == value) { |
- json_string_->append(Int64ToString(static_cast<int64>(value))); |
+ json_string_->append(Int64ToString(static_cast<int64_t>(value))); |
return result; |
} |
std::string real = DoubleToString(value); |