summaryrefslogtreecommitdiffstats
path: root/gl/m4/float_h.m4
diff options
context:
space:
mode:
Diffstat (limited to 'gl/m4/float_h.m4')
-rw-r--r--gl/m4/float_h.m433
1 files changed, 30 insertions, 3 deletions
diff --git a/gl/m4/float_h.m4 b/gl/m4/float_h.m4
index c95d4171..c0ee7f8f 100644
--- a/gl/m4/float_h.m4
+++ b/gl/m4/float_h.m4
@@ -1,9 +1,10 @@
1# float_h.m4 1# float_h.m4
2# serial 14 2# serial 17
3dnl Copyright (C) 2007, 2009-2024 Free Software Foundation, Inc. 3dnl Copyright (C) 2007, 2009-2026 Free Software Foundation, Inc.
4dnl This file is free software; the Free Software Foundation 4dnl This file is free software; the Free Software Foundation
5dnl gives unlimited permission to copy and/or distribute it, 5dnl gives unlimited permission to copy and/or distribute it,
6dnl with or without modifications, as long as this notice is preserved. 6dnl with or without modifications, as long as this notice is preserved.
7dnl This file is offered as-is, without any warranty.
7 8
8AC_DEFUN([gl_FLOAT_H], 9AC_DEFUN([gl_FLOAT_H],
9[ 10[
@@ -12,7 +13,7 @@ AC_DEFUN([gl_FLOAT_H],
12 GL_GENERATE_FLOAT_H=false 13 GL_GENERATE_FLOAT_H=false
13 REPLACE_FLOAT_LDBL=0 14 REPLACE_FLOAT_LDBL=0
14 case "$host_os" in 15 case "$host_os" in
15 aix* | beos* | openbsd* | mirbsd* | irix*) 16 aix* | beos* | openbsd* | mirbsd*)
16 GL_GENERATE_FLOAT_H=true 17 GL_GENERATE_FLOAT_H=true
17 ;; 18 ;;
18 freebsd* | dragonfly*) 19 freebsd* | dragonfly*)
@@ -54,6 +55,32 @@ changequote([,])dnl
54 ;; 55 ;;
55 esac 56 esac
56 57
58 dnl Test for completeness w.r.t. ISO C 23.
59 REPLACE_FLOAT_SNAN=0
60 AC_CACHE_CHECK([whether float.h conforms to ISO C23],
61 [gl_cv_header_float_h_isoc23],
62 [AC_COMPILE_IFELSE(
63 [AC_LANG_PROGRAM(
64 [[#include <float.h>
65 int x[] = { FLT_DECIMAL_DIG, DBL_DECIMAL_DIG, LDBL_DECIMAL_DIG };
66 int y[] = { FLT_IS_IEC_60559, DBL_IS_IEC_60559, LDBL_IS_IEC_60559 };
67 float maxf = FLT_NORM_MAX;
68 double maxd = DBL_NORM_MAX;
69 long double maxl = LDBL_NORM_MAX;
70 ]],
71 [[float sf = FLT_SNAN;
72 double sd = DBL_SNAN;
73 long double sl = LDBL_SNAN;
74 return (sf != 0) + (sd != 0) + (sl != 0);
75 ]])],
76 [gl_cv_header_float_h_isoc23=yes],
77 [gl_cv_header_float_h_isoc23=no])
78 ])
79 if test $gl_cv_header_float_h_isoc23 != yes; then
80 GL_GENERATE_FLOAT_H=true
81 REPLACE_FLOAT_SNAN=1
82 fi
83
57 dnl Test against glibc-2.7 Linux/SPARC64 bug. 84 dnl Test against glibc-2.7 Linux/SPARC64 bug.
58 REPLACE_ITOLD=0 85 REPLACE_ITOLD=0
59 AC_CACHE_CHECK([whether conversion from 'int' to 'long double' works], 86 AC_CACHE_CHECK([whether conversion from 'int' to 'long double' works],