diff options
author | Holger Weiss <holger@zedat.fu-berlin.de> | 2013-08-19 23:27:12 +0200 |
---|---|---|
committer | Holger Weiss <holger@zedat.fu-berlin.de> | 2013-08-19 23:27:12 +0200 |
commit | 26fbe7f1e68bb0c96da32491efcf3696fe6c299b (patch) | |
tree | c4d95289187a64e9c7517bf73d8208026c3d2fb3 /gl/m4/stdint.m4 | |
parent | 5f79e3e9f62ca5487d9881973149136ba1d19d3e (diff) | |
download | monitoring-plugins-26fbe7f1e68bb0c96da32491efcf3696fe6c299b.tar.gz |
Sync with the latest Gnulib code (6f2d632)
Diffstat (limited to 'gl/m4/stdint.m4')
-rw-r--r-- | gl/m4/stdint.m4 | 40 |
1 files changed, 26 insertions, 14 deletions
diff --git a/gl/m4/stdint.m4 b/gl/m4/stdint.m4 index c5e813a9..27cdcdb9 100644 --- a/gl/m4/stdint.m4 +++ b/gl/m4/stdint.m4 | |||
@@ -1,5 +1,5 @@ | |||
1 | # stdint.m4 serial 35 | 1 | # stdint.m4 serial 43 |
2 | dnl Copyright (C) 2001-2010 Free Software Foundation, Inc. | 2 | dnl Copyright (C) 2001-2013 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. |
@@ -7,7 +7,7 @@ dnl with or without modifications, as long as this notice is preserved. | |||
7 | dnl From Paul Eggert and Bruno Haible. | 7 | dnl From Paul Eggert and Bruno Haible. |
8 | dnl Test whether <stdint.h> is supported or must be substituted. | 8 | dnl Test whether <stdint.h> is supported or must be substituted. |
9 | 9 | ||
10 | AC_DEFUN([gl_STDINT_H], | 10 | AC_DEFUN_ONCE([gl_STDINT_H], |
11 | [ | 11 | [ |
12 | AC_PREREQ([2.59])dnl | 12 | AC_PREREQ([2.59])dnl |
13 | 13 | ||
@@ -27,6 +27,15 @@ AC_DEFUN([gl_STDINT_H], | |||
27 | fi | 27 | fi |
28 | AC_SUBST([HAVE_UNSIGNED_LONG_LONG_INT]) | 28 | AC_SUBST([HAVE_UNSIGNED_LONG_LONG_INT]) |
29 | 29 | ||
30 | dnl Check for <wchar.h>, in the same way as gl_WCHAR_H does. | ||
31 | AC_CHECK_HEADERS_ONCE([wchar.h]) | ||
32 | if test $ac_cv_header_wchar_h = yes; then | ||
33 | HAVE_WCHAR_H=1 | ||
34 | else | ||
35 | HAVE_WCHAR_H=0 | ||
36 | fi | ||
37 | AC_SUBST([HAVE_WCHAR_H]) | ||
38 | |||
30 | dnl Check for <inttypes.h>. | 39 | dnl Check for <inttypes.h>. |
31 | dnl AC_INCLUDES_DEFAULT defines $ac_cv_header_inttypes_h. | 40 | dnl AC_INCLUDES_DEFAULT defines $ac_cv_header_inttypes_h. |
32 | if test $ac_cv_header_inttypes_h = yes; then | 41 | if test $ac_cv_header_inttypes_h = yes; then |
@@ -60,8 +69,6 @@ AC_DEFUN([gl_STDINT_H], | |||
60 | [gl_cv_header_working_stdint_h=no | 69 | [gl_cv_header_working_stdint_h=no |
61 | AC_COMPILE_IFELSE([ | 70 | AC_COMPILE_IFELSE([ |
62 | AC_LANG_PROGRAM([[ | 71 | AC_LANG_PROGRAM([[ |
63 | #define __STDC_LIMIT_MACROS 1 /* to make it work also in C++ mode */ | ||
64 | #define __STDC_CONSTANT_MACROS 1 /* to make it work also in C++ mode */ | ||
65 | #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */ | 72 | #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */ |
66 | #include <stdint.h> | 73 | #include <stdint.h> |
67 | /* Dragonfly defines WCHAR_MIN, WCHAR_MAX only in <wchar.h>. */ | 74 | /* Dragonfly defines WCHAR_MIN, WCHAR_MAX only in <wchar.h>. */ |
@@ -145,9 +152,11 @@ uintmax_t j = UINTMAX_MAX; | |||
145 | 152 | ||
146 | #include <limits.h> /* for CHAR_BIT */ | 153 | #include <limits.h> /* for CHAR_BIT */ |
147 | #define TYPE_MINIMUM(t) \ | 154 | #define TYPE_MINIMUM(t) \ |
148 | ((t) ((t) 0 < (t) -1 ? (t) 0 : ~ (t) 0 << (sizeof (t) * CHAR_BIT - 1))) | 155 | ((t) ((t) 0 < (t) -1 ? (t) 0 : ~ TYPE_MAXIMUM (t))) |
149 | #define TYPE_MAXIMUM(t) \ | 156 | #define TYPE_MAXIMUM(t) \ |
150 | ((t) ((t) 0 < (t) -1 ? (t) -1 : ~ (~ (t) 0 << (sizeof (t) * CHAR_BIT - 1)))) | 157 | ((t) ((t) 0 < (t) -1 \ |
158 | ? (t) -1 \ | ||
159 | : ((((t) 1 << (sizeof (t) * CHAR_BIT - 2)) - 1) * 2 + 1))) | ||
151 | struct s { | 160 | struct s { |
152 | int check_PTRDIFF: | 161 | int check_PTRDIFF: |
153 | PTRDIFF_MIN == TYPE_MINIMUM (ptrdiff_t) | 162 | PTRDIFF_MIN == TYPE_MINIMUM (ptrdiff_t) |
@@ -208,8 +217,6 @@ struct s { | |||
208 | dnl This detects a bug on HP-UX 11.23/ia64. | 217 | dnl This detects a bug on HP-UX 11.23/ia64. |
209 | AC_RUN_IFELSE([ | 218 | AC_RUN_IFELSE([ |
210 | AC_LANG_PROGRAM([[ | 219 | AC_LANG_PROGRAM([[ |
211 | #define __STDC_LIMIT_MACROS 1 /* to make it work also in C++ mode */ | ||
212 | #define __STDC_CONSTANT_MACROS 1 /* to make it work also in C++ mode */ | ||
213 | #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */ | 220 | #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */ |
214 | #include <stdint.h> | 221 | #include <stdint.h> |
215 | ] | 222 | ] |
@@ -259,7 +266,7 @@ static const char *macro_values[] = | |||
259 | || strncmp (value, "((int)"/*)*/, 6) == 0 | 266 | || strncmp (value, "((int)"/*)*/, 6) == 0 |
260 | || strncmp (value, "((signed short)"/*)*/, 15) == 0 | 267 | || strncmp (value, "((signed short)"/*)*/, 15) == 0 |
261 | || strncmp (value, "((signed char)"/*)*/, 14) == 0) | 268 | || strncmp (value, "((signed char)"/*)*/, 14) == 0) |
262 | return 1; | 269 | return mv - macro_values + 1; |
263 | } | 270 | } |
264 | return 0; | 271 | return 0; |
265 | ]])], | 272 | ]])], |
@@ -290,14 +297,11 @@ static const char *macro_values[] = | |||
290 | fi | 297 | fi |
291 | AC_SUBST([HAVE_SYS_BITYPES_H]) | 298 | AC_SUBST([HAVE_SYS_BITYPES_H]) |
292 | 299 | ||
293 | dnl Check for <wchar.h> (missing in Linux uClibc when built without wide | ||
294 | dnl character support). | ||
295 | AC_CHECK_HEADERS_ONCE([wchar.h]) | ||
296 | |||
297 | gl_STDINT_TYPE_PROPERTIES | 300 | gl_STDINT_TYPE_PROPERTIES |
298 | STDINT_H=stdint.h | 301 | STDINT_H=stdint.h |
299 | fi | 302 | fi |
300 | AC_SUBST([STDINT_H]) | 303 | AC_SUBST([STDINT_H]) |
304 | AM_CONDITIONAL([GL_GENERATE_STDINT_H], [test -n "$STDINT_H"]) | ||
301 | ]) | 305 | ]) |
302 | 306 | ||
303 | dnl gl_STDINT_BITSIZEOF(TYPES, INCLUDES) | 307 | dnl gl_STDINT_BITSIZEOF(TYPES, INCLUDES) |
@@ -458,6 +462,14 @@ AC_DEFUN([gl_STDINT_TYPE_PROPERTIES], | |||
458 | fi | 462 | fi |
459 | gl_INTEGER_TYPE_SUFFIX([sig_atomic_t wchar_t wint_t], | 463 | gl_INTEGER_TYPE_SUFFIX([sig_atomic_t wchar_t wint_t], |
460 | [gl_STDINT_INCLUDES]) | 464 | [gl_STDINT_INCLUDES]) |
465 | |||
466 | dnl If wint_t is smaller than 'int', it cannot satisfy the ISO C 99 | ||
467 | dnl requirement that wint_t is "unchanged by default argument promotions". | ||
468 | dnl In this case gnulib's <wchar.h> and <wctype.h> override wint_t. | ||
469 | dnl Set the variable BITSIZEOF_WINT_T accordingly. | ||
470 | if test $BITSIZEOF_WINT_T -lt 32; then | ||
471 | BITSIZEOF_WINT_T=32 | ||
472 | fi | ||
461 | ]) | 473 | ]) |
462 | 474 | ||
463 | dnl Autoconf >= 2.61 has AC_COMPUTE_INT built-in. | 475 | dnl Autoconf >= 2.61 has AC_COMPUTE_INT built-in. |