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.m431
1 files changed, 23 insertions, 8 deletions
diff --git a/gl/m4/limits-h.m4 b/gl/m4/limits-h.m4
index 5088fa1..1b619e1 100644
--- a/gl/m4/limits-h.m4
+++ b/gl/m4/limits-h.m4
@@ -1,10 +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-2024 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.
7 7
8dnl Check whether limits.h has needed features.
9
8dnl From Paul Eggert. 10dnl From Paul Eggert.
9 11
10AC_DEFUN_ONCE([gl_LIMITS_H], 12AC_DEFUN_ONCE([gl_LIMITS_H],
@@ -23,14 +25,27 @@ AC_DEFUN_ONCE([gl_LIMITS_H],
23 int wb = WORD_BIT; 25 int wb = WORD_BIT;
24 int ullw = ULLONG_WIDTH; 26 int ullw = ULLONG_WIDTH;
25 int bw = BOOL_WIDTH; 27 int bw = BOOL_WIDTH;
28 int bm = BOOL_MAX;
29 int mblm = MB_LEN_MAX;
26 ]])], 30 ]])],
27 [gl_cv_header_limits_width=yes], 31 [gl_cv_header_limits_width=yes],
28 [gl_cv_header_limits_width=no])]) 32 [gl_cv_header_limits_width=no])])
29 if test "$gl_cv_header_limits_width" = yes; then 33 GL_GENERATE_LIMITS_H=true
30 GL_GENERATE_LIMITS_H=false 34 AS_IF([test "$gl_cv_header_limits_width" = yes],
31 else 35 [AC_CACHE_CHECK([whether limits.h has SSIZE_MAX],
32 GL_GENERATE_LIMITS_H=true 36 [gl_cv_header_limits_ssize_max],
33 fi 37 [AC_COMPILE_IFELSE(
38 [AC_LANG_SOURCE(
39 [[#include <limits.h>
40 #ifndef SSIZE_MAX
41 #error "SSIZE_MAX is not defined"
42 #endif
43 ]])],
44 [gl_cv_header_limits_ssize_max=yes],
45 [gl_cv_header_limits_ssize_max=no])])
46 if test "$gl_cv_header_limits_ssize_max" = yes; then
47 GL_GENERATE_LIMITS_H=false
48 fi])
34]) 49])
35 50
36dnl Unconditionally enables the replacement of <limits.h>. 51dnl Unconditionally enables the replacement of <limits.h>.