diff options
author | Thomas Guyot-Sionnest <dermoth@aei.ca> | 2009-01-15 09:22:57 (GMT) |
---|---|---|
committer | Thomas Guyot-Sionnest <dermoth@aei.ca> | 2009-01-15 10:19:08 (GMT) |
commit | 71cdb52799220f8d9052643baf1d3e9836a9c755 (patch) | |
tree | 27aee97a35d9ab51f0d8f64a46690bd41a5f8c1b /gl/m4/size_max.m4 | |
parent | f7afa46586645e50498d8b2d0c67884f014dc3a4 (diff) | |
download | monitoring-plugins-71cdb52799220f8d9052643baf1d3e9836a9c755.tar.gz |
Sync with gnulib
Diffstat (limited to 'gl/m4/size_max.m4')
-rw-r--r-- | gl/m4/size_max.m4 | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/gl/m4/size_max.m4 b/gl/m4/size_max.m4 index 6cb4868..e0e7b3f 100644 --- a/gl/m4/size_max.m4 +++ b/gl/m4/size_max.m4 | |||
@@ -1,5 +1,5 @@ | |||
1 | # size_max.m4 serial 6 | 1 | # size_max.m4 serial 7 |
2 | dnl Copyright (C) 2003, 2005-2006 Free Software Foundation, Inc. | 2 | dnl Copyright (C) 2003, 2005-2006, 2008 Free Software Foundation, Inc. |
3 | dnl This file is free software; the Free Software Foundation | 3 | dnl This file is free software; the Free Software Foundation |
4 | dnl gives unlimited permission to copy and/or distribute it, | 4 | dnl gives unlimited permission to copy and/or distribute it, |
5 | dnl with or without modifications, as long as this notice is preserved. | 5 | dnl with or without modifications, as long as this notice is preserved. |
@@ -8,7 +8,7 @@ dnl From Bruno Haible. | |||
8 | 8 | ||
9 | AC_DEFUN([gl_SIZE_MAX], | 9 | AC_DEFUN([gl_SIZE_MAX], |
10 | [ | 10 | [ |
11 | AC_CHECK_HEADERS(stdint.h) | 11 | AC_CHECK_HEADERS([stdint.h]) |
12 | dnl First test whether the system already has SIZE_MAX. | 12 | dnl First test whether the system already has SIZE_MAX. |
13 | AC_MSG_CHECKING([for SIZE_MAX]) | 13 | AC_MSG_CHECKING([for SIZE_MAX]) |
14 | AC_CACHE_VAL([gl_cv_size_max], [ | 14 | AC_CACHE_VAL([gl_cv_size_max], [ |
@@ -21,16 +21,16 @@ AC_DEFUN([gl_SIZE_MAX], | |||
21 | #ifdef SIZE_MAX | 21 | #ifdef SIZE_MAX |
22 | Found it | 22 | Found it |
23 | #endif | 23 | #endif |
24 | ], gl_cv_size_max=yes) | 24 | ], [gl_cv_size_max=yes]) |
25 | if test -z "$gl_cv_size_max"; then | 25 | if test -z "$gl_cv_size_max"; then |
26 | dnl Define it ourselves. Here we assume that the type 'size_t' is not wider | 26 | dnl Define it ourselves. Here we assume that the type 'size_t' is not wider |
27 | dnl than the type 'unsigned long'. Try hard to find a definition that can | 27 | dnl than the type 'unsigned long'. Try hard to find a definition that can |
28 | dnl be used in a preprocessor #if, i.e. doesn't contain a cast. | 28 | dnl be used in a preprocessor #if, i.e. doesn't contain a cast. |
29 | AC_COMPUTE_INT([size_t_bits_minus_1], [sizeof (size_t) * CHAR_BIT - 1], | 29 | AC_COMPUTE_INT([size_t_bits_minus_1], [sizeof (size_t) * CHAR_BIT - 1], |
30 | [#include <stddef.h> | 30 | [#include <stddef.h> |
31 | #include <limits.h>], size_t_bits_minus_1=) | 31 | #include <limits.h>], [size_t_bits_minus_1=]) |
32 | AC_COMPUTE_INT([fits_in_uint], [sizeof (size_t) <= sizeof (unsigned int)], | 32 | AC_COMPUTE_INT([fits_in_uint], [sizeof (size_t) <= sizeof (unsigned int)], |
33 | [#include <stddef.h>], fits_in_uint=) | 33 | [#include <stddef.h>], [fits_in_uint=]) |
34 | if test -n "$size_t_bits_minus_1" && test -n "$fits_in_uint"; then | 34 | if test -n "$size_t_bits_minus_1" && test -n "$fits_in_uint"; then |
35 | if test $fits_in_uint = 1; then | 35 | if test $fits_in_uint = 1; then |
36 | dnl Even though SIZE_MAX fits in an unsigned int, it must be of type | 36 | dnl Even though SIZE_MAX fits in an unsigned int, it must be of type |
@@ -38,7 +38,7 @@ Found it | |||
38 | AC_TRY_COMPILE([#include <stddef.h> | 38 | AC_TRY_COMPILE([#include <stddef.h> |
39 | extern size_t foo; | 39 | extern size_t foo; |
40 | extern unsigned long foo; | 40 | extern unsigned long foo; |
41 | ], [], fits_in_uint=0) | 41 | ], [], [fits_in_uint=0]) |
42 | fi | 42 | fi |
43 | dnl We cannot use 'expr' to simplify this expression, because 'expr' | 43 | dnl We cannot use 'expr' to simplify this expression, because 'expr' |
44 | dnl works only with 'long' integers in the host environment, while we | 44 | dnl works only with 'long' integers in the host environment, while we |