mirror of
https://github.com/ziglang/zig.git
synced 2026-02-20 00:08:56 +00:00
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:
parent
974977f12f
commit
f00adb47f5
@ -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:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user