Commit 8d427ad6 authored by Thomas Jahns's avatar Thomas Jahns 🤸
Browse files

isnan is not guaranteed to be a function.

* And on AIX it isn't.
parent 25346d75
......@@ -13,7 +13,7 @@
#include <cdi.h>
int vlistInqVarMissvalUsed(int vlistID, int varID);
#ifndef DBL_IS_NAN
#if defined (HAVE_ISNAN)
#if defined (HAVE_DECL_ISNAN)
# define DBL_IS_NAN(x) (isnan(x))
#elif defined (FP_NAN)
# define DBL_IS_NAN(x) (fpclassify(x) == FP_NAN)
......
......@@ -2332,6 +2332,52 @@ fi
eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
 
} # ac_fn_c_check_header_mongrel
# ac_fn_c_check_decl LINENO SYMBOL VAR INCLUDES
# ---------------------------------------------
# Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR
# accordingly.
ac_fn_c_check_decl ()
{
as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
as_decl_name=`echo $2|sed 's/ *(.*//'`
as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'`
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5
$as_echo_n "checking whether $as_decl_name is declared... " >&6; }
if eval \${$3+:} false; then :
$as_echo_n "(cached) " >&6
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
$4
int
main ()
{
#ifndef $as_decl_name
#ifdef __cplusplus
(void) $as_decl_use;
#else
(void) $as_decl_name;
#endif
#endif
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
eval "$3=yes"
else
eval "$3=no"
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
eval ac_res=\$$3
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
$as_echo "$ac_res" >&6; }
eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
} # ac_fn_c_check_decl
cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
......@@ -23905,16 +23951,18 @@ done
 
# ----------------------------------------------------------------------
# Checks for the availability of ANSI-C99 functions
for ac_func in isnan
do :
ac_fn_c_check_func "$LINENO" "isnan" "ac_cv_func_isnan"
if test "x$ac_cv_func_isnan" = xyes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_ISNAN 1
_ACEOF
ac_fn_c_check_decl "$LINENO" "isnan" "ac_cv_have_decl_isnan" "$ac_includes_default
#include <math.h>
"
if test "x$ac_cv_have_decl_isnan" = xyes; then :
ac_have_decl=1
else
ac_have_decl=0
fi
done
cat >>confdefs.h <<_ACEOF
#define HAVE_DECL_ISNAN $ac_have_decl
_ACEOF
 
# ----------------------------------------------------------------------
# Check for math library
......
......@@ -79,7 +79,8 @@ AC_CHECK_HEADERS(malloc.h)
AC_CHECK_FUNCS(mallinfo)
# ----------------------------------------------------------------------
# Checks for the availability of ANSI-C99 functions
AC_CHECK_FUNCS(isnan)
AC_CHECK_DECLS([isnan],,,[AC_INCLUDES_DEFAULT
@%:@include <math.h>])
# ----------------------------------------------------------------------
# Check for math library
AC_CHECK_LIB(m, floor)
......
......@@ -81,7 +81,7 @@
#endif
#else
#ifndef DBL_IS_NAN
#if defined (HAVE_ISNAN)
#if defined (HAVE_DECL_ISNAN)
# define DBL_IS_NAN(x) (isnan(x))
#elif defined (FP_NAN)
# define DBL_IS_NAN(x) (fpclassify(x) == FP_NAN)
......
......@@ -3,6 +3,10 @@
/* Define if C / Fortran interface cfortran.h works */
#undef HAVE_CF_INTERFACE
/* 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 <dlfcn.h> header file. */
#undef HAVE_DLFCN_H
......@@ -18,9 +22,6 @@
/* Define to 1 if you have the <inttypes.h> header file. */
#undef HAVE_INTTYPES_H
/* Define to 1 if you have the `isnan' function. */
#undef HAVE_ISNAN
/* Define to 1 if you have the <jasper.h> header file. */
#undef HAVE_JASPER_H
......
......@@ -66,7 +66,7 @@ char *strdup(const char *s);
#endif
#else
#ifndef DBL_IS_NAN
#if defined (HAVE_ISNAN)
#if defined (HAVE_DECL_ISNAN)
# define DBL_IS_NAN(x) (isnan(x))
#elif defined (FP_NAN)
# define DBL_IS_NAN(x) (fpclassify(x) == FP_NAN)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment