Commit 68a68125 authored by Kenton Varda's avatar Kenton Varda

Merge pull request #306 from mologie/fix-json-osx-build

Fix building with Xcode 7.3
parents 3c7ae27a 078bb0b9
...@@ -20,9 +20,9 @@ ...@@ -20,9 +20,9 @@
// THE SOFTWARE. // THE SOFTWARE.
#include "json.h" #include "json.h"
#include <math.h> // for HUGEVAL to check for overflow in std::strtod #include <math.h> // for HUGEVAL to check for overflow in strtod
#include <stdlib.h> // std::strtod #include <stdlib.h> // strtod
#include <errno.h> // for std::strtod errors #include <errno.h> // for strtod errors
#include <unordered_map> #include <unordered_map>
#include <capnp/orphan.h> #include <capnp/orphan.h>
#include <kj/debug.h> #include <kj/debug.h>
...@@ -518,7 +518,7 @@ public: ...@@ -518,7 +518,7 @@ public:
char *endPtr; char *endPtr;
errno = 0; errno = 0;
double value = std::strtod(numberStr.begin(), &endPtr); double value = strtod(numberStr.begin(), &endPtr);
KJ_ASSERT(endPtr != numberStr.begin(), "strtod should not fail! Is consumeNumber wrong?"); KJ_ASSERT(endPtr != numberStr.begin(), "strtod should not fail! Is consumeNumber wrong?");
KJ_REQUIRE((value != HUGE_VAL && value != -HUGE_VAL) || errno != ERANGE, KJ_REQUIRE((value != HUGE_VAL && value != -HUGE_VAL) || errno != ERANGE,
......
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