aboutsummaryrefslogtreecommitdiffstats
path: root/lib
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 /lib
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 'lib')
-rw-r--r--lib/erl_interface/src/decode/decode_big.c11
-rw-r--r--lib/test_server/src/configure.in18
2 files changed, 25 insertions, 4 deletions
diff --git a/lib/erl_interface/src/decode/decode_big.c b/lib/erl_interface/src/decode/decode_big.c
index b54ac85be2..b87d97d634 100644
--- a/lib/erl_interface/src/decode/decode_big.c
+++ b/lib/erl_interface/src/decode/decode_big.c
@@ -151,13 +151,18 @@ int ei_big_comp(erlang_big *x, erlang_big *y)
#endif
#ifdef USE_ISINF_ISNAN /* simulate finite() */
-# define finite(f) (!isinf(f) && !isnan(f))
-# define HAVE_FINITE
+# define isfinite(f) (!isinf(f) && !isnan(f))
+# define HAVE_ISFINITE
+#elif defined(isfinite) && !defined(HAVE_ISFINITE)
+# define HAVE_ISFINITE
+#elif !defined(HAVE_ISFINITE) && defined(HAVE_FINITE)
+# define isfinite finite
+# define HAVE_ISFINITE
#endif
#ifdef NO_FPE_SIGNALS
# define ERTS_FP_CHECK_INIT() do {} while (0)
-# define ERTS_FP_ERROR(f, Action) if (!finite(f)) { Action; } else {}
+# define ERTS_FP_ERROR(f, Action) if (!isfinite(f)) { Action; } else {}
# define ERTS_SAVE_FP_EXCEPTION()
# define ERTS_RESTORE_FP_EXCEPTION()
#else
diff --git a/lib/test_server/src/configure.in b/lib/test_server/src/configure.in
index cd723bcd4d..8398825d95 100644
--- a/lib/test_server/src/configure.in
+++ b/lib/test_server/src/configure.in
@@ -357,7 +357,23 @@ AC_CHECK_FUNCS(usleep)
# First check if the library is available, then if we can choose between
# two versions of gethostbyname
AC_HAVE_LIBRARY(resolv)
-AC_CHECK_LIB(resolv, res_gethostbyname,[DEFS="$DEFS -DHAVE_RES_GETHOSTBYNAME=1"])
+AC_CHECK_LIB(resolv, res_gethostbyname,[AC_DEFINE(HAVE_RES_GETHOSTBYNAME,1)])
+
+#--------------------------------------------------------------------
+# Check for isfinite
+#--------------------------------------------------------------------
+
+AC_MSG_CHECKING([for isfinite])
+AC_TRY_LINK([#include <math.h>],
+ [isfinite(0);], have_isfinite=yes, have_isfinite=no)
+
+if test $have_isfinite = yes; then
+ AC_DEFINE(HAVE_ISFINITE,1)
+ AC_MSG_RESULT(yes)
+else
+ AC_DEFINE(HAVE_FINITE,1)
+ AC_MSG_RESULT(no)
+fi
#--------------------------------------------------------------------
# Emulator compatible flags (for drivers)