summaryrefslogtreecommitdiffstats
path: root/gl/m4/limits-h.m4
diff options
context:
space:
mode:
Diffstat (limited to 'gl/m4/limits-h.m4')
-rw-r--r--gl/m4/limits-h.m432
1 files changed, 24 insertions, 8 deletions
diff --git a/gl/m4/limits-h.m4 b/gl/m4/limits-h.m4
index 5088fa16..202df492 100644
--- a/gl/m4/limits-h.m4
+++ b/gl/m4/limits-h.m4
@@ -1,9 +1,12 @@
1dnl Check whether limits.h has needed features. 1# limits-h.m4
2 2# serial 1
3dnl Copyright 2016-2023 Free Software Foundation, Inc. 3dnl Copyright 2016-2025 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.
8
9dnl Check whether limits.h has needed features.
7 10
8dnl From Paul Eggert. 11dnl From Paul Eggert.
9 12
@@ -23,14 +26,27 @@ AC_DEFUN_ONCE([gl_LIMITS_H],
23 int wb = WORD_BIT; 26 int wb = WORD_BIT;
24 int ullw = ULLONG_WIDTH; 27 int ullw = ULLONG_WIDTH;
25 int bw = BOOL_WIDTH; 28 int bw = BOOL_WIDTH;
29 int bm = BOOL_MAX;
30 int mblm = MB_LEN_MAX;
26 ]])], 31 ]])],
27 [gl_cv_header_limits_width=yes], 32 [gl_cv_header_limits_width=yes],
28 [gl_cv_header_limits_width=no])]) 33 [gl_cv_header_limits_width=no])])
29 if test "$gl_cv_header_limits_width" = yes; then 34 GL_GENERATE_LIMITS_H=true
30 GL_GENERATE_LIMITS_H=false 35 AS_IF([test "$gl_cv_header_limits_width" = yes],
31 else 36 [AC_CACHE_CHECK([whether limits.h has SSIZE_MAX],
32 GL_GENERATE_LIMITS_H=true 37 [gl_cv_header_limits_ssize_max],
33 fi 38 [AC_COMPILE_IFELSE(
39 [AC_LANG_SOURCE(
40 [[#include <limits.h>
41 #ifndef SSIZE_MAX
42 #error "SSIZE_MAX is not defined"
43 #endif
44 ]])],
45 [gl_cv_header_limits_ssize_max=yes],
46 [gl_cv_header_limits_ssize_max=no])])
47 if test "$gl_cv_header_limits_ssize_max" = yes; then
48 GL_GENERATE_LIMITS_H=false
49 fi])
34]) 50])
35 51
36dnl Unconditionally enables the replacement of <limits.h>. 52dnl Unconditionally enables the replacement of <limits.h>.