aboutsummaryrefslogtreecommitdiff
path: root/src/ir.cpp
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2019-04-06 01:03:30 -0400
committerAndrew Kelley <andrew@ziglang.org>2019-04-06 01:03:30 -0400
commitf00adb47f5c2b70496dac1c48f03236271b9bd57 (patch)
treefeec3e2bebd850b6a56c329031fff5403da62657 /src/ir.cpp
parent974977f12f06726d96e751106cc06eb02f6b0147 (diff)
downloadzig-f00adb47f5c2b70496dac1c48f03236271b9bd57.tar.gz
zig-f00adb47f5c2b70496dac1c48f03236271b9bd57.zip
ir: avoid dependency on isnan
there's a simple way to check for nan that does not need this header. hryx on IRC reported that Linux Mint based on ubuntu 16.04, kernel 4.15.0, x86_64 did not have the isnan function.
Diffstat (limited to 'src/ir.cpp')
-rw-r--r--src/ir.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/ir.cpp b/src/ir.cpp
index 1e9cc5d18c..b602df29ad 100644
--- a/src/ir.cpp
+++ b/src/ir.cpp
@@ -17,7 +17,6 @@
#include "util.hpp"
#include <errno.h>
-#include <math.h>
struct IrExecContext {
ZigList<ConstExprValue *> mem_slot_list;
@@ -8251,9 +8250,9 @@ static bool float_is_nan(ConstExprValue *op) {
case 16:
return f16_isSignalingNaN(op->data.x_f16);
case 32:
- return isnan(op->data.x_f32);
+ return op->data.x_f32 != op->data.x_f32;
case 64:
- return isnan(op->data.x_f64);
+ return op->data.x_f64 != op->data.x_f64;
case 128:
return f128M_isSignalingNaN(&op->data.x_f128);
default: