]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
isinf and isnan are macros, not functions; fix configure script
authorMark Dickinson <dickinsm@gmail.com>
Sun, 4 Jan 2009 13:57:26 +0000 (13:57 +0000)
committerMark Dickinson <dickinsm@gmail.com>
Sun, 4 Jan 2009 13:57:26 +0000 (13:57 +0000)
to use AC_CHECK_DECLS instead of AC_CHECK_FUNCS for these.
(See discussion in issue #4506)

Include/pymath.h
PC/pyconfig.h
configure
configure.in
pyconfig.h.in

index 7cea9ae22f443ee1d7a25e8d5cf920afc97b180d..13f95b4ff1d1f04beafb3d279079ec40e5f5d501 100644 (file)
@@ -87,7 +87,7 @@ extern double copysign(double, double);
  * Note: PC/pyconfig.h defines Py_IS_NAN as _isnan
  */
 #ifndef Py_IS_NAN
-#ifdef HAVE_ISNAN
+#ifdef HAVE_DECL_ISNAN
 #define Py_IS_NAN(X) isnan(X)
 #else
 #define Py_IS_NAN(X) ((X) != (X))
@@ -104,7 +104,7 @@ extern double copysign(double, double);
  * Note: PC/pyconfig.h defines Py_IS_INFINITY as _isinf
  */
 #ifndef Py_IS_INFINITY
-#ifdef HAVE_ISINF
+#ifdef HAVE_DECL_ISINF
 #define Py_IS_INFINITY(X) isinf(X)
 #else
 #define Py_IS_INFINITY(X) ((X) && (X)*0.5 == (X))
index d2874017efa8e562f7c358e352ba1f30f62515ea..255554ad9e65d525707c29e41b14b3622efef723 100644 (file)
@@ -399,11 +399,11 @@ Py_NO_ENABLE_SHARED to find out.  Also support MS_NO_COREDLL for b/w compat */
 /* Define to 1 if you have the `copysign' function. */
 #define HAVE_COPYSIGN 1
 
-/* Define to 1 if you have the `isinf' function. */
-#define HAVE_ISINF 1
+/* Define to 1 if you have the `isinf' macro. */
+#define HAVE_DECL_ISINF 1
 
 /* Define to 1 if you have the `isnan' function. */
-#define HAVE_ISNAN 1
+#define HAVE_DECL_ISNAN 1
 
 /* Define if on AIX 3.
    System headers sometimes define this.
index 70bad0a2b1d1d3aedc91ae8945e50773bda987df..235773ffce2df5253bb51586ace8d4d98c3eb034 100755 (executable)
--- a/configure
+++ b/configure
@@ -1,5 +1,5 @@
 #! /bin/sh
-# From configure.in Revision: 68292 .
+# From configure.in Revision: 68296 .
 # Guess values for system-dependent variables and create Makefiles.
 # Generated by GNU Autoconf 2.61 for python 2.7.
 #
@@ -21797,9 +21797,7 @@ done
 
 
 
-
-
-for ac_func in acosh asinh atanh copysign expm1 finite isinf isnan log1p
+for ac_func in acosh asinh atanh copysign expm1 finite log1p
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
 { echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -21892,6 +21890,209 @@ _ACEOF
 fi
 done
 
+{ echo "$as_me:$LINENO: checking whether isinf is declared" >&5
+echo $ECHO_N "checking whether isinf is declared... $ECHO_C" >&6; }
+if test "${ac_cv_have_decl_isinf+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <math.h>
+
+int
+main ()
+{
+#ifndef isinf
+  (void) isinf;
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_have_decl_isinf=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_cv_have_decl_isinf=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_isinf" >&5
+echo "${ECHO_T}$ac_cv_have_decl_isinf" >&6; }
+if test $ac_cv_have_decl_isinf = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_ISINF 1
+_ACEOF
+
+
+else
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_ISINF 0
+_ACEOF
+
+
+fi
+{ echo "$as_me:$LINENO: checking whether isnan is declared" >&5
+echo $ECHO_N "checking whether isnan is declared... $ECHO_C" >&6; }
+if test "${ac_cv_have_decl_isnan+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <math.h>
+
+int
+main ()
+{
+#ifndef isnan
+  (void) isnan;
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_have_decl_isnan=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_cv_have_decl_isnan=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_isnan" >&5
+echo "${ECHO_T}$ac_cv_have_decl_isnan" >&6; }
+if test $ac_cv_have_decl_isnan = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_ISNAN 1
+_ACEOF
+
+
+else
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_ISNAN 0
+_ACEOF
+
+
+fi
+{ echo "$as_me:$LINENO: checking whether isfinite is declared" >&5
+echo $ECHO_N "checking whether isfinite is declared... $ECHO_C" >&6; }
+if test "${ac_cv_have_decl_isfinite+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <math.h>
+
+int
+main ()
+{
+#ifndef isfinite
+  (void) isfinite;
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_have_decl_isfinite=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_cv_have_decl_isfinite=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_isfinite" >&5
+echo "${ECHO_T}$ac_cv_have_decl_isfinite" >&6; }
+if test $ac_cv_have_decl_isfinite = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_ISFINITE 1
+_ACEOF
+
+
+else
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_ISFINITE 0
+_ACEOF
+
+
+fi
+
+
 
 LIBS=$LIBS_SAVE
 
index ea8727c4bd19cdcdce9f828f2465898f6a234c8d..e1854a219ea3796e3bef433e8ce299c84108ba57 100644 (file)
@@ -3209,7 +3209,8 @@ fi
 
 AC_REPLACE_FUNCS(hypot)
 
-AC_CHECK_FUNCS(acosh asinh atanh copysign expm1 finite isinf isnan log1p)
+AC_CHECK_FUNCS([acosh asinh atanh copysign expm1 finite log1p])
+AC_CHECK_DECLS([isinf, isnan, isfinite], [], [], [[#include <math.h>]])
 
 LIBS=$LIBS_SAVE
 
index e3fb0a5857c732d9a0a5cc612c77b82d657f0716..82285bd36ada17f47424c25c977c8d1abaac68f5 100644 (file)
 /* Define if you have the 'resize_term' function. */
 #undef HAVE_CURSES_RESIZE_TERM
 
+/* Define to 1 if you have the declaration of `isfinite', and to 0 if you
+   don't. */
+#undef HAVE_DECL_ISFINITE
+
+/* Define to 1 if you have the declaration of `isinf', and to 0 if you don't.
+   */
+#undef HAVE_DECL_ISINF
+
+/* Define to 1 if you have the declaration of `isnan', and to 0 if you don't.
+   */
+#undef HAVE_DECL_ISNAN
+
 /* Define to 1 if you have the declaration of `tzname', and to 0 if you don't.
    */
 #undef HAVE_DECL_TZNAME
 /* Define to 1 if you have the <io.h> header file. */
 #undef HAVE_IO_H
 
-/* Define to 1 if you have the `isinf' function. */
-#undef HAVE_ISINF
-
-/* Define to 1 if you have the `isnan' function. */
-#undef HAVE_ISNAN
-
 /* Define to 1 if you have the `kill' function. */
 #undef HAVE_KILL