diff options
| author | Paul Eggert | 2016-04-03 23:12:04 -0700 |
|---|---|---|
| committer | Paul Eggert | 2016-04-03 23:12:29 -0700 |
| commit | f501116ea896b20f195f5c841e8770d7fe0418b9 (patch) | |
| tree | acba39c6874e999c1b914838bf0bd2b60ec13e25 /m4/stdint.m4 | |
| parent | c4963f9a905bf15740aa7e3ebf85af917f17be15 (diff) | |
| download | emacs-f501116ea896b20f195f5c841e8770d7fe0418b9.tar.gz emacs-f501116ea896b20f195f5c841e8770d7fe0418b9.zip | |
Sync with gnulib
This incorporates:
2016-04-03 stdint: detect good enough pre-C++11 stdint.h in C++ mode
2016-04-01 stddef: support configuring with g++
* doc/misc/texinfo.tex, lib/stddef.in.h, m4/stdint.m4:
Copy from gnulib.
Diffstat (limited to 'm4/stdint.m4')
| -rw-r--r-- | m4/stdint.m4 | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/m4/stdint.m4 b/m4/stdint.m4 index 0f40ce803b7..0b4b9060dbb 100644 --- a/m4/stdint.m4 +++ b/m4/stdint.m4 | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | # stdint.m4 serial 43 | 1 | # stdint.m4 serial 44 |
| 2 | dnl Copyright (C) 2001-2016 Free Software Foundation, Inc. | 2 | dnl Copyright (C) 2001-2016 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, |
| @@ -70,6 +70,8 @@ AC_DEFUN_ONCE([gl_STDINT_H], | |||
| 70 | AC_COMPILE_IFELSE([ | 70 | AC_COMPILE_IFELSE([ |
| 71 | AC_LANG_PROGRAM([[ | 71 | AC_LANG_PROGRAM([[ |
| 72 | #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 */ |
| 73 | #define __STDC_CONSTANT_MACROS 1 | ||
| 74 | #define __STDC_LIMIT_MACROS 1 | ||
| 73 | #include <stdint.h> | 75 | #include <stdint.h> |
| 74 | /* Dragonfly defines WCHAR_MIN, WCHAR_MAX only in <wchar.h>. */ | 76 | /* Dragonfly defines WCHAR_MIN, WCHAR_MAX only in <wchar.h>. */ |
| 75 | #if !(defined WCHAR_MIN && defined WCHAR_MAX) | 77 | #if !(defined WCHAR_MIN && defined WCHAR_MAX) |
| @@ -218,6 +220,8 @@ struct s { | |||
| 218 | AC_RUN_IFELSE([ | 220 | AC_RUN_IFELSE([ |
| 219 | AC_LANG_PROGRAM([[ | 221 | AC_LANG_PROGRAM([[ |
| 220 | #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */ | 222 | #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */ |
| 223 | #define __STDC_CONSTANT_MACROS 1 | ||
| 224 | #define __STDC_LIMIT_MACROS 1 | ||
| 221 | #include <stdint.h> | 225 | #include <stdint.h> |
| 222 | ] | 226 | ] |
| 223 | gl_STDINT_INCLUDES | 227 | gl_STDINT_INCLUDES |
| @@ -279,6 +283,29 @@ static const char *macro_values[] = | |||
| 279 | ]) | 283 | ]) |
| 280 | fi | 284 | fi |
| 281 | if test "$gl_cv_header_working_stdint_h" = yes; then | 285 | if test "$gl_cv_header_working_stdint_h" = yes; then |
| 286 | dnl Now see whether the system <stdint.h> works without | ||
| 287 | dnl __STDC_CONSTANT_MACROS/__STDC_LIMIT_MACROS defined. | ||
| 288 | AC_CACHE_CHECK([whether stdint.h predates C++11], | ||
| 289 | [gl_cv_header_stdint_predates_cxx11_h], | ||
| 290 | [gl_cv_header_stdint_predates_cxx11_h=yes | ||
| 291 | AC_COMPILE_IFELSE([ | ||
| 292 | AC_LANG_PROGRAM([[ | ||
| 293 | #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */ | ||
| 294 | #include <stdint.h> | ||
| 295 | ] | ||
| 296 | gl_STDINT_INCLUDES | ||
| 297 | [ | ||
| 298 | intmax_t im = INTMAX_MAX; | ||
| 299 | int32_t i32 = INT32_C (0x7fffffff); | ||
| 300 | ]])], | ||
| 301 | [gl_cv_header_stdint_predates_cxx11_h=no])]) | ||
| 302 | |||
| 303 | if test "$gl_cv_header_stdint_predates_cxx11_h" = yes; then | ||
| 304 | AC_DEFINE([__STDC_CONSTANT_MACROS], [1], | ||
| 305 | [Define to 1 if the system <stdint.h> predates C++11.]) | ||
| 306 | AC_DEFINE([__STDC_LIMIT_MACROS], [1], | ||
| 307 | [Define to 1 if the system <stdint.h> predates C++11.]) | ||
| 308 | fi | ||
| 282 | STDINT_H= | 309 | STDINT_H= |
| 283 | else | 310 | else |
| 284 | dnl Check for <sys/inttypes.h>, and for | 311 | dnl Check for <sys/inttypes.h>, and for |