+dnl Test whether isnanf() recognizes a NaN (this fails on IRIX 6.5) and rejects
+dnl Infinity (this fails on Solaris 2.5.1).
+AC_DEFUN([gl_ISNANF_WORKS],
+[
+ AC_REQUIRE([AC_PROG_CC])
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+ AC_CACHE_CHECK([whether isnan(float) works], [gl_cv_func_isnanf_works],
+ [
+ AC_TRY_RUN([
+#include <math.h>
+#ifdef isnan
+# undef isnanf
+# define isnanf(x) isnan ((float)(x))
+#endif
+/* The Compaq (ex-DEC) C 6.4 compiler chokes on the expression 0.0 / 0.0. */
+#ifdef __DECC
+static float
+NaN ()
+{
+ static float zero = 0.0f;
+ return zero / zero;
+}
+#else
+# define NaN() (0.0f / 0.0f)
+#endif
+int main()
+{
+ if (!isnanf (NaN ()))
+ return 1;
+ if (isnanf (1.0f / 0.0f))
+ return 1;
+ return 0;
+}], [gl_cv_func_isnanf_works=yes], [gl_cv_func_isnanf_works=no],
+ [case "$host_os" in
+ irix* | solaris*) gl_cv_func_isnanf_works="guessing no";;
+ *) gl_cv_func_isnanf_works="guessing yes";;
+ esac
+ ])
+ ])
+])
+