aboutsummaryrefslogtreecommitdiffstats
path: root/m4/stdint.m4
diff options
context:
space:
mode:
authorPaul Eggert2016-09-15 11:50:23 -0700
committerPaul Eggert2016-09-15 15:55:30 -0700
commit8f4b6a20bfec96086845b2f7161e121b1e41b4ad (patch)
treee8c4a85626437b0f77ed0a7b575e7627d45dce9e /m4/stdint.m4
parent3c586e182c0694896dda670f5fc663b46c9bac63 (diff)
downloademacs-8f4b6a20bfec96086845b2f7161e121b1e41b4ad.tar.gz
emacs-8f4b6a20bfec96086845b2f7161e121b1e41b4ad.zip
Update from gnulib
This incorporates: 2016-09-15 stdint: support new _WIDTH macros 2016-09-15 limits-h: new module 2016-09-15 sys_types: avoid glibc 2.25 warnings about major() 2016-09-15 extensions: port to more ISO C TSes 2016-09-13 intprops: new macro TYPE_WIDTH 2016-09-13 extensions: port to recent ISO C TRs * .gitignore: Add lib/limits.h. * doc/misc/texinfo.tex, lib/ftoastr.h, lib/intprops.h: * lib/stdint.in.h, m4/extensions.m4, m4/stdint.m4, m4/stdio_h.m4: * m4/sys_types_h.m4: Copy from gnulib. * lib/gnulib.mk, m4/gnulib-comp.m4: Regenerate. * lib/limits.in.h, m4/limits-h.m4: New files, copie from gnulib. * nt/gnulib.mk: Merge changes from lib/gnulib.mk.
Diffstat (limited to 'm4/stdint.m4')
-rw-r--r--m4/stdint.m448
1 files changed, 32 insertions, 16 deletions
diff --git a/m4/stdint.m4 b/m4/stdint.m4
index 0b4b9060dbb..52f7814ef84 100644
--- a/m4/stdint.m4
+++ b/m4/stdint.m4
@@ -1,4 +1,4 @@
1# stdint.m4 serial 44 1# stdint.m4 serial 45
2dnl Copyright (C) 2001-2016 Free Software Foundation, Inc. 2dnl Copyright (C) 2001-2016 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,
@@ -11,6 +11,8 @@ AC_DEFUN_ONCE([gl_STDINT_H],
11[ 11[
12 AC_PREREQ([2.59])dnl 12 AC_PREREQ([2.59])dnl
13 13
14 AC_REQUIRE([gl_LIMITS_H])
15
14 dnl Check for long long int and unsigned long long int. 16 dnl Check for long long int and unsigned long long int.
15 AC_REQUIRE([AC_TYPE_LONG_LONG_INT]) 17 AC_REQUIRE([AC_TYPE_LONG_LONG_INT])
16 if test $ac_cv_type_long_long_int = yes; then 18 if test $ac_cv_type_long_long_int = yes; then
@@ -282,14 +284,20 @@ static const char *macro_values[] =
282 ]) 284 ])
283 ]) 285 ])
284 fi 286 fi
287
288 HAVE_C99_STDINT_H=0
289 HAVE_SYS_BITYPES_H=0
290 HAVE_SYS_INTTYPES_H=0
291 STDINT_H=stdint.h
285 if test "$gl_cv_header_working_stdint_h" = yes; then 292 if test "$gl_cv_header_working_stdint_h" = yes; then
293 HAVE_C99_STDINT_H=1
286 dnl Now see whether the system <stdint.h> works without 294 dnl Now see whether the system <stdint.h> works without
287 dnl __STDC_CONSTANT_MACROS/__STDC_LIMIT_MACROS defined. 295 dnl __STDC_CONSTANT_MACROS/__STDC_LIMIT_MACROS defined.
288 AC_CACHE_CHECK([whether stdint.h predates C++11], 296 AC_CACHE_CHECK([whether stdint.h predates C++11],
289 [gl_cv_header_stdint_predates_cxx11_h], 297 [gl_cv_header_stdint_predates_cxx11_h],
290 [gl_cv_header_stdint_predates_cxx11_h=yes 298 [gl_cv_header_stdint_predates_cxx11_h=yes
291 AC_COMPILE_IFELSE([ 299 AC_COMPILE_IFELSE([
292 AC_LANG_PROGRAM([[ 300 AC_LANG_PROGRAM([[
293#define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */ 301#define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */
294#include <stdint.h> 302#include <stdint.h>
295] 303]
@@ -306,27 +314,40 @@ int32_t i32 = INT32_C (0x7fffffff);
306 AC_DEFINE([__STDC_LIMIT_MACROS], [1], 314 AC_DEFINE([__STDC_LIMIT_MACROS], [1],
307 [Define to 1 if the system <stdint.h> predates C++11.]) 315 [Define to 1 if the system <stdint.h> predates C++11.])
308 fi 316 fi
309 STDINT_H= 317 AC_CACHE_CHECK([whether stdint.h has UINTMAX_WIDTH etc.],
318 [gl_cv_header_stdint_width],
319 [gl_cv_header_stdint_width=no
320 AC_COMPILE_IFELSE(
321 [AC_LANG_PROGRAM([[
322 /* Work if build is not clean. */
323 #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1
324 #include <stdint.h>
325 ]gl_STDINT_INCLUDES[
326 int iw = UINTMAX_WIDTH;
327 ]])],
328 [gl_cv_header_stdint_width=yes])])
329 if test "$gl_cv_header_stdint_width" = yes; then
330 STDINT_H=
331 fi
310 else 332 else
311 dnl Check for <sys/inttypes.h>, and for 333 dnl Check for <sys/inttypes.h>, and for
312 dnl <sys/bitypes.h> (used in Linux libc4 >= 4.6.7 and libc5). 334 dnl <sys/bitypes.h> (used in Linux libc4 >= 4.6.7 and libc5).
313 AC_CHECK_HEADERS([sys/inttypes.h sys/bitypes.h]) 335 AC_CHECK_HEADERS([sys/inttypes.h sys/bitypes.h])
314 if test $ac_cv_header_sys_inttypes_h = yes; then 336 if test $ac_cv_header_sys_inttypes_h = yes; then
315 HAVE_SYS_INTTYPES_H=1 337 HAVE_SYS_INTTYPES_H=1
316 else
317 HAVE_SYS_INTTYPES_H=0
318 fi 338 fi
319 AC_SUBST([HAVE_SYS_INTTYPES_H])
320 if test $ac_cv_header_sys_bitypes_h = yes; then 339 if test $ac_cv_header_sys_bitypes_h = yes; then
321 HAVE_SYS_BITYPES_H=1 340 HAVE_SYS_BITYPES_H=1
322 else
323 HAVE_SYS_BITYPES_H=0
324 fi 341 fi
325 AC_SUBST([HAVE_SYS_BITYPES_H])
326
327 gl_STDINT_TYPE_PROPERTIES 342 gl_STDINT_TYPE_PROPERTIES
328 STDINT_H=stdint.h
329 fi 343 fi
344
345 # The substitute stdint.h needs the substitute limit.h's _GL_INTEGER_WIDTH.
346 test -z "$STDINT_H" || LIMITS_H=limits.h
347
348 AC_SUBST([HAVE_C99_STDINT_H])
349 AC_SUBST([HAVE_SYS_BITYPES_H])
350 AC_SUBST([HAVE_SYS_INTTYPES_H])
330 AC_SUBST([STDINT_H]) 351 AC_SUBST([STDINT_H])
331 AM_CONDITIONAL([GL_GENERATE_STDINT_H], [test -n "$STDINT_H"]) 352 AM_CONDITIONAL([GL_GENERATE_STDINT_H], [test -n "$STDINT_H"])
332]) 353])
@@ -504,8 +525,3 @@ dnl Remove this when we can assume autoconf >= 2.61.
504m4_ifdef([AC_COMPUTE_INT], [], [ 525m4_ifdef([AC_COMPUTE_INT], [], [
505 AC_DEFUN([AC_COMPUTE_INT], [_AC_COMPUTE_INT([$2],[$1],[$3],[$4])]) 526 AC_DEFUN([AC_COMPUTE_INT], [_AC_COMPUTE_INT([$2],[$1],[$3],[$4])])
506]) 527])
507
508# Hey Emacs!
509# Local Variables:
510# indent-tabs-mode: nil
511# End: