summaryrefslogtreecommitdiff
path: root/gnulib-m4/float_h.m4
diff options
context:
space:
mode:
Diffstat (limited to 'gnulib-m4/float_h.m4')
-rw-r--r--gnulib-m4/float_h.m428
1 files changed, 27 insertions, 1 deletions
diff --git a/gnulib-m4/float_h.m4 b/gnulib-m4/float_h.m4
index 60e81447..12c0eb67 100644
--- a/gnulib-m4/float_h.m4
+++ b/gnulib-m4/float_h.m4
@@ -1,4 +1,5 @@
-# float_h.m4 serial 14
+# float_h.m4
+# serial 15
dnl Copyright (C) 2007, 2009-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -53,6 +54,31 @@ changequote([,])dnl
;;
esac
+ dnl Test for completeness w.r.t. ISO C 23.
+ REPLACE_FLOAT_SNAN=0
+ AC_CACHE_CHECK([whether float.h conforms to ISO C23],
+ [gl_cv_header_float_h_isoc23],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <float.h>
+ int x[] = { FLT_DECIMAL_DIG, DBL_DECIMAL_DIG, LDBL_DECIMAL_DIG };
+ float maxf = FLT_NORM_MAX;
+ double maxd = DBL_NORM_MAX;
+ long double maxl = LDBL_NORM_MAX;
+ ]],
+ [[float sf = FLT_SNAN;
+ double sd = DBL_SNAN;
+ long double sl = LDBL_SNAN;
+ return (sf != 0) + (sd != 0) + (sl != 0);
+ ]])],
+ [gl_cv_header_float_h_isoc23=yes],
+ [gl_cv_header_float_h_isoc23=no])
+ ])
+ if test $gl_cv_header_float_h_isoc23 != yes; then
+ GL_GENERATE_FLOAT_H=true
+ REPLACE_FLOAT_SNAN=1
+ fi
+
dnl Test against glibc-2.7 Linux/SPARC64 bug.
REPLACE_ITOLD=0
AC_CACHE_CHECK([whether conversion from 'int' to 'long double' works],