summaryrefslogtreecommitdiffstats
path: root/gl/m4/size_max.m4
diff options
context:
space:
mode:
Diffstat (limited to 'gl/m4/size_max.m4')
-rw-r--r--gl/m4/size_max.m416
1 files changed, 6 insertions, 10 deletions
diff --git a/gl/m4/size_max.m4 b/gl/m4/size_max.m4
index 4b247ab..0763366 100644
--- a/gl/m4/size_max.m4
+++ b/gl/m4/size_max.m4
@@ -1,17 +1,19 @@
1# size_max.m4 serial 10 1# size_max.m4 serial 12
2dnl Copyright (C) 2003, 2005-2006, 2008-2013 Free Software Foundation, Inc. 2dnl Copyright (C) 2003, 2005-2006, 2008-2023 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation 3dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it, 4dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved. 5dnl with or without modifications, as long as this notice is preserved.
6 6
7dnl From Bruno Haible. 7dnl From Bruno Haible.
8 8
9AC_PREREQ([2.61])
10
9AC_DEFUN([gl_SIZE_MAX], 11AC_DEFUN([gl_SIZE_MAX],
10[ 12[
11 AC_CHECK_HEADERS([stdint.h]) 13 AC_CHECK_HEADERS([stdint.h])
12 dnl First test whether the system already has SIZE_MAX. 14 dnl First test whether the system already has SIZE_MAX.
13 AC_CACHE_CHECK([for SIZE_MAX], [gl_cv_size_max], [ 15 AC_CACHE_CHECK([for SIZE_MAX], [gl_cv_size_max], [
14 gl_cv_size_max= 16 gl_cv_size_max=no
15 AC_EGREP_CPP([Found it], [ 17 AC_EGREP_CPP([Found it], [
16#include <limits.h> 18#include <limits.h>
17#if HAVE_STDINT_H 19#if HAVE_STDINT_H
@@ -21,7 +23,7 @@ AC_DEFUN([gl_SIZE_MAX],
21Found it 23Found it
22#endif 24#endif
23], [gl_cv_size_max=yes]) 25], [gl_cv_size_max=yes])
24 if test -z "$gl_cv_size_max"; then 26 if test $gl_cv_size_max != yes; then
25 dnl Define it ourselves. Here we assume that the type 'size_t' is not wider 27 dnl Define it ourselves. Here we assume that the type 'size_t' is not wider
26 dnl than the type 'unsigned long'. Try hard to find a definition that can 28 dnl than the type 'unsigned long'. Try hard to find a definition that can
27 dnl be used in a preprocessor #if, i.e. doesn't contain a cast. 29 dnl be used in a preprocessor #if, i.e. doesn't contain a cast.
@@ -71,9 +73,3 @@ Found it
71# undef SIZE_MAX 73# undef SIZE_MAX
72#endif]) 74#endif])
73]) 75])
74
75dnl Autoconf >= 2.61 has AC_COMPUTE_INT built-in.
76dnl Remove this when we can assume autoconf >= 2.61.
77m4_ifdef([AC_COMPUTE_INT], [], [
78 AC_DEFUN([AC_COMPUTE_INT], [_AC_COMPUTE_INT([$2],[$1],[$3],[$4])])
79])