summaryrefslogtreecommitdiff
path: root/json_object.c
diff options
context:
space:
mode:
Diffstat (limited to 'json_object.c')
-rw-r--r--json_object.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/json_object.c b/json_object.c
index 527cd31..04164d0 100644
--- a/json_object.c
+++ b/json_object.c
@@ -903,15 +903,11 @@ static int json_object_double_to_json_string_format(struct json_object *jso, str
* ECMA 262 section 9.8.1 defines
* how to handle these cases as strings
*/
-#ifdef HAVE_DECL_ISNAN
if (isnan(jso->o.c_double))
{
size = snprintf(buf, sizeof(buf), "NaN");
}
- else
-#endif
-#ifdef HAVE_DECL_ISINF
- if (isinf(jso->o.c_double))
+ else if (isinf(jso->o.c_double))
{
if (jso->o.c_double > 0)
size = snprintf(buf, sizeof(buf), "Infinity");
@@ -919,7 +915,6 @@ static int json_object_double_to_json_string_format(struct json_object *jso, str
size = snprintf(buf, sizeof(buf), "-Infinity");
}
else
-#endif
{
const char *std_format = "%.17g";
int format_drops_decimals = 0;