rint: Determine RINT_LIBM correctly on AIX 7.
[gnulib.git] / m4 / frexpl.m4
index 63fcb1a..e9f9964 100644 (file)
@@ -1,4 +1,4 @@
-# frexpl.m4 serial 14
+# frexpl.m4 serial 17
 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,
@@ -9,7 +9,7 @@ AC_DEFUN([gl_FUNC_FREXPL],
   AC_REQUIRE([gl_MATH_H_DEFAULTS])
   dnl Check whether it's declared.
   dnl MacOS X 10.3 has frexpl() in libc but doesn't declare it in <math.h>.
-  AC_CHECK_DECL([frexpl], , [HAVE_DECL_FREXPL=0], [#include <math.h>])
+  AC_CHECK_DECL([frexpl], , [HAVE_DECL_FREXPL=0], [[#include <math.h>]])
   FREXPL_LIBM=
   if test $HAVE_DECL_FREXPL = 1; then
     gl_CHECK_FREXPL_NO_LIBM
@@ -58,7 +58,7 @@ AC_DEFUN([gl_FUNC_FREXPL_NO_LIBM],
   AC_REQUIRE([gl_MATH_H_DEFAULTS])
   dnl Check whether it's declared.
   dnl MacOS X 10.3 has frexpl() in libc but doesn't declare it in <math.h>.
-  AC_CHECK_DECL([frexpl], , [HAVE_DECL_FREXPL=0], [#include <math.h>])
+  AC_CHECK_DECL([frexpl], , [HAVE_DECL_FREXPL=0], [[#include <math.h>]])
   if test $HAVE_DECL_FREXPL = 1; then
     gl_CHECK_FREXPL_NO_LIBM
     if test $gl_cv_func_frexpl_no_libm = yes; then
@@ -115,7 +115,25 @@ AC_DEFUN([gl_FUNC_FREXPL_WORKS],
 # undef LDBL_MIN_EXP
 # define LDBL_MIN_EXP    (-16381)
 #endif
-extern long double frexpl (long double, int *);
+#if defined __i386__ && defined __FreeBSD__
+# undef LDBL_MIN_EXP
+# define LDBL_MIN_EXP    (-16381)
+#endif
+#if (defined _ARCH_PPC || defined _POWER) && defined _AIX && (LDBL_MANT_DIG == 106) && defined __GNUC__
+# undef LDBL_MIN_EXP
+# define LDBL_MIN_EXP DBL_MIN_EXP
+#endif
+#if defined __sgi && (LDBL_MANT_DIG >= 106)
+# if defined __GNUC__
+#  undef LDBL_MIN_EXP
+#  define LDBL_MIN_EXP DBL_MIN_EXP
+# endif
+#endif
+extern
+#ifdef __cplusplus
+"C"
+#endif
+long double frexpl (long double, int *);
 int main()
 {
   int result = 0;