From f00adb47f5c2b70496dac1c48f03236271b9bd57 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Sat, 6 Apr 2019 01:03:30 -0400 Subject: 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. --- src/ir.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/ir.cpp') 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 -#include struct IrExecContext { ZigList 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: -- cgit v1.2.3