changeset 15284:85f546d97fb5

isfinite, isinf: Fix link error on AIX 6 and 7. * m4/isfinite.m4 (gl_ISFINITE): When determining whether libm is needed, also test the macro with a 'float' argument. * m4/isinf.m4 (gl_ISINF): Likewise.
author Bruno Haible <bruno@clisp.org>
date Sat, 18 Jun 2011 20:26:19 +0200
parents c0393c370200
children 2e40714e3fb0
files ChangeLog m4/isfinite.m4 m4/isinf.m4
diffstat 3 files changed, 12 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2011-06-18  Bruno Haible  <bruno@clisp.org>
+
+	isfinite, isinf: Fix link error on AIX 6 and 7.
+	* m4/isfinite.m4 (gl_ISFINITE): When determining whether libm is
+	needed, also test the macro with a 'float' argument.
+	* m4/isinf.m4 (gl_ISINF): Likewise.
+
 2011-06-18  Bruno Haible  <bruno@clisp.org>
 
 	getloadavg: Don't clobber LIBS. Regression from previous commit.
--- a/m4/isfinite.m4
+++ b/m4/isfinite.m4
@@ -1,4 +1,4 @@
-# isfinite.m4 serial 9
+# isfinite.m4 serial 10
 dnl Copyright (C) 2007-2011 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -11,7 +11,8 @@
   AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
   AC_CHECK_DECLS([isfinite], , , [#include <math.h>])
   if test "$ac_cv_have_decl_isfinite" = yes; then
-    gl_CHECK_MATH_LIB([ISFINITE_LIBM], [x = isfinite (x);])
+    gl_CHECK_MATH_LIB([ISFINITE_LIBM],
+     [x = isfinite (x) + isfinite ((float) x);])
     if test "$ISFINITE_LIBM" != missing; then
       dnl Test whether isfinite() on 'long double' works.
       gl_ISFINITEL_WORKS
--- a/m4/isinf.m4
+++ b/m4/isinf.m4
@@ -1,4 +1,4 @@
-# isinf.m4 serial 4
+# isinf.m4 serial 5
 dnl Copyright (C) 2007-2011 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -11,7 +11,7 @@
   AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
   AC_CHECK_DECLS([isinf], , , [#include <math.h>])
   if test "$ac_cv_have_decl_isinf" = yes; then
-    gl_CHECK_MATH_LIB([ISINF_LIBM], [x = isinf (x);])
+    gl_CHECK_MATH_LIB([ISINF_LIBM], [x = isinf (x) + isinf ((float) x);])
     if test "$ISINF_LIBM" != missing; then
       dnl Test whether isinf() on 'long double' works.
       gl_ISINFL_WORKS