diff options
Diffstat (limited to 'winsup/mingw/mingwex/isnan.c')
-rw-r--r-- | winsup/mingw/mingwex/isnan.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/winsup/mingw/mingwex/isnan.c b/winsup/mingw/mingwex/isnan.c new file mode 100644 index 000000000..b38bc290e --- /dev/null +++ b/winsup/mingw/mingwex/isnan.c @@ -0,0 +1,14 @@ +#include <math.h> + +int +__isnan (double _x) +{ + unsigned short _sw; + __asm__ ("fxam;" + "fstsw %%ax": "=a" (_sw) : "t" (_x)); + return (_sw & (FP_NAN | FP_NORMAL | FP_INFINITE | FP_ZERO | FP_SUBNORMAL)) + == FP_NAN; +} + +#undef isnan +int __attribute__ ((alias ("__isnan"))) isnan (double); |