summaryrefslogtreecommitdiffstats
path: root/gl/m4/stdint.m4
diff options
context:
space:
mode:
Diffstat (limited to 'gl/m4/stdint.m4')
-rw-r--r--gl/m4/stdint.m421
1 files changed, 13 insertions, 8 deletions
diff --git a/gl/m4/stdint.m4 b/gl/m4/stdint.m4
index d6961b09..2d69088b 100644
--- a/gl/m4/stdint.m4
+++ b/gl/m4/stdint.m4
@@ -1,8 +1,10 @@
1# stdint.m4 serial 61 1# stdint.m4
2dnl Copyright (C) 2001-2023 Free Software Foundation, Inc. 2# serial 64
3dnl Copyright (C) 2001-2025 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation 4dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it, 5dnl gives unlimited permission to copy and/or distribute it,
5dnl 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.
6 8
7dnl From Paul Eggert and Bruno Haible. 9dnl From Paul Eggert and Bruno Haible.
8dnl Test whether <stdint.h> is supported or must be substituted. 10dnl Test whether <stdint.h> is supported or must be substituted.
@@ -150,10 +152,13 @@ intmax_t i = INTMAX_MAX;
150uintmax_t j = UINTMAX_MAX; 152uintmax_t j = UINTMAX_MAX;
151 153
152/* Check that SIZE_MAX has the correct type, if possible. */ 154/* Check that SIZE_MAX has the correct type, if possible. */
153#if 201112 <= __STDC_VERSION__ 155/* ISO C 11 mandates _Generic, but GCC versions < 4.9 lack it. */
156#if 201112 <= __STDC_VERSION__ \
157 && (!defined __GNUC__ || 4 < __GNUC__ + (9 <= __GNUC_MINOR__) \
158 || defined __clang__)
154int k = _Generic (SIZE_MAX, size_t: 0); 159int k = _Generic (SIZE_MAX, size_t: 0);
155#elif (2 <= __GNUC__ || 4 <= __clang_major__ || defined __IBM__TYPEOF__ \ 160#elif (2 <= __GNUC__ || 4 <= __clang_major__ || defined __IBM__TYPEOF__ \
156 || (0x5110 <= __SUNPRO_C && !__STDC__)) 161 || (0x5110 <= __SUNPRO_C && !__STDC__) || 1939 <= _MSC_VER)
157extern size_t k; 162extern size_t k;
158extern __typeof__ (SIZE_MAX) k; 163extern __typeof__ (SIZE_MAX) k;
159#endif 164#endif
@@ -283,10 +288,10 @@ static const char *macro_values[] =
283 [gl_cv_header_working_stdint_h=yes], 288 [gl_cv_header_working_stdint_h=yes],
284 [], 289 [],
285 [case "$host_os" in 290 [case "$host_os" in
286 # Guess yes on native Windows. 291 # Guess yes on native Windows.
287 mingw*) gl_cv_header_working_stdint_h="guessing yes" ;; 292 mingw* | windows*) gl_cv_header_working_stdint_h="guessing yes" ;;
288 # In general, assume it works. 293 # In general, assume it works.
289 *) gl_cv_header_working_stdint_h="guessing yes" ;; 294 *) gl_cv_header_working_stdint_h="guessing yes" ;;
290 esac 295 esac
291 ]) 296 ])
292 ]) 297 ])