aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/test
diff options
context:
space:
mode:
authorLukas Larsson <[email protected]>2014-10-28 11:43:07 +0100
committerLukas Larsson <[email protected]>2014-10-28 11:43:07 +0100
commitd1d6a655545ddf3c088bf06f3f8636a5cf3b9fe2 (patch)
tree851b4d7d399e29796b58a139c2907b55fead5541 /erts/emulator/test
parent7d08338b0742fd4b24cdd87ee9f098ec09fcecea (diff)
parent3a4433d67cb2f14c5ed69e8eae7b772eebcaa30b (diff)
downloadotp-d1d6a655545ddf3c088bf06f3f8636a5cf3b9fe2.tar.gz
otp-d1d6a655545ddf3c088bf06f3f8636a5cf3b9fe2.tar.bz2
otp-d1d6a655545ddf3c088bf06f3f8636a5cf3b9fe2.zip
Merge branch 'maint'
* maint: Use isfinite() instead of finite() when available
Diffstat (limited to 'erts/emulator/test')
-rw-r--r--erts/emulator/test/float_SUITE_data/fp_drv.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/erts/emulator/test/float_SUITE_data/fp_drv.c b/erts/emulator/test/float_SUITE_data/fp_drv.c
index b80385c3f9..82d18d6440 100644
--- a/erts/emulator/test/float_SUITE_data/fp_drv.c
+++ b/erts/emulator/test/float_SUITE_data/fp_drv.c
@@ -29,9 +29,14 @@
#if defined (__GNUC__)
int _finite(double x);
#endif
-#ifndef finite
-#define finite _finite
+#ifndef isfinite
+#define isfinite _finite
#endif
+#elif !defined(HAVE_ISFINITE) && defined(HAVE_FINITE)
+/* If not windows and we do not have isfinite */
+#define isfinite finite
+#elif !defined(HAVE_ISFINITE)
+# error "No finite function found!"
#endif
#include "erl_driver.h"
@@ -79,21 +84,21 @@ do_test(void *unused)
x = 3.23e133;
y = 3.57e257;
z = x*y;
- if (finite(z))
+ if (isfinite(z))
return "is finite (1)";
x = 5.0;
y = 0.0;
z = x/y;
- if (finite(z))
+ if (isfinite(z))
return "is finite (2)";
z = log(-1.0);
- if (finite(z))
+ if (isfinite(z))
return "is finite (3)";
z = log(0.0);
- if (finite(z))
+ if (isfinite(z))
return "is finite (4)";
return "ok";