diff options
Diffstat (limited to 'gl/m4/float_h.m4')
| -rw-r--r-- | gl/m4/float_h.m4 | 39 |
1 files changed, 34 insertions, 5 deletions
diff --git a/gl/m4/float_h.m4 b/gl/m4/float_h.m4 index 2f0c9c4e..8580c9c9 100644 --- a/gl/m4/float_h.m4 +++ b/gl/m4/float_h.m4 | |||
| @@ -1,8 +1,10 @@ | |||
| 1 | # float_h.m4 serial 13 | 1 | # float_h.m4 |
| 2 | dnl Copyright (C) 2007, 2009-2023 Free Software Foundation, Inc. | 2 | # serial 15 |
| 3 | dnl Copyright (C) 2007, 2009-2025 Free Software Foundation, Inc. | ||
| 3 | dnl This file is free software; the Free Software Foundation | 4 | dnl This file is free software; the Free Software Foundation |
| 4 | dnl gives unlimited permission to copy and/or distribute it, | 5 | dnl gives unlimited permission to copy and/or distribute it, |
| 5 | dnl with or without modifications, as long as this notice is preserved. | 6 | dnl with or without modifications, as long as this notice is preserved. |
| 7 | dnl This file is offered as-is, without any warranty. | ||
| 6 | 8 | ||
| 7 | AC_DEFUN([gl_FLOAT_H], | 9 | AC_DEFUN([gl_FLOAT_H], |
| 8 | [ | 10 | [ |
| @@ -53,6 +55,31 @@ changequote([,])dnl | |||
| 53 | ;; | 55 | ;; |
| 54 | esac | 56 | esac |
| 55 | 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 | float maxf = FLT_NORM_MAX; | ||
| 67 | double maxd = DBL_NORM_MAX; | ||
| 68 | long double maxl = LDBL_NORM_MAX; | ||
| 69 | ]], | ||
| 70 | [[float sf = FLT_SNAN; | ||
| 71 | double sd = DBL_SNAN; | ||
| 72 | long double sl = LDBL_SNAN; | ||
| 73 | return (sf != 0) + (sd != 0) + (sl != 0); | ||
| 74 | ]])], | ||
| 75 | [gl_cv_header_float_h_isoc23=yes], | ||
| 76 | [gl_cv_header_float_h_isoc23=no]) | ||
| 77 | ]) | ||
| 78 | if test $gl_cv_header_float_h_isoc23 != yes; then | ||
| 79 | GL_GENERATE_FLOAT_H=true | ||
| 80 | REPLACE_FLOAT_SNAN=1 | ||
| 81 | fi | ||
| 82 | |||
| 56 | dnl Test against glibc-2.7 Linux/SPARC64 bug. | 83 | dnl Test against glibc-2.7 Linux/SPARC64 bug. |
| 57 | REPLACE_ITOLD=0 | 84 | REPLACE_ITOLD=0 |
| 58 | AC_CACHE_CHECK([whether conversion from 'int' to 'long double' works], | 85 | AC_CACHE_CHECK([whether conversion from 'int' to 'long double' works], |
| @@ -84,9 +111,11 @@ int main () | |||
| 84 | [gl_cv_func_itold_works="guessing no"], | 111 | [gl_cv_func_itold_works="guessing no"], |
| 85 | [gl_cv_func_itold_works="guessing yes"]) | 112 | [gl_cv_func_itold_works="guessing yes"]) |
| 86 | ;; | 113 | ;; |
| 87 | # Guess yes on native Windows. | 114 | # Guess yes on native Windows. |
| 88 | mingw*) gl_cv_func_itold_works="guessing yes" ;; | 115 | mingw* | windows*) |
| 89 | *) gl_cv_func_itold_works="guessing yes" ;; | 116 | gl_cv_func_itold_works="guessing yes" ;; |
| 117 | *) | ||
| 118 | gl_cv_func_itold_works="guessing yes" ;; | ||
| 90 | esac | 119 | esac |
| 91 | ]) | 120 | ]) |
| 92 | ]) | 121 | ]) |
