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.
This commit is contained in:
Andrew Kelley 2019-04-06 01:03:30 -04:00
parent 974977f12f
commit f00adb47f5
No known key found for this signature in database
GPG Key ID: 7C5F548F728501A9

View File

@ -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: