diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2011-04-25 19:33:14 -0700 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2011-04-26 12:18:14 -0700 |
commit | 23e09df46ae150007e6208af1be628fd2d63d986 (patch) | |
tree | 7e02a9f0568745cb9cdb3223e9536b9d697d0266 /m4/inttypes.m4 | |
parent | 537168321f3784bb33330f5df6b9b169075ba833 (diff) | |
download | gnulib-23e09df46ae150007e6208af1be628fd2d63d986.tar.gz |
inttypes-incomplete: new module
* m4/inttypes.m4 (gl_INTTYPES_INCOMPLETE): New macro, containing
all but the PRI* and SCN* parts of gl_INTTYPES_H.
(gl_INTTYPES_PRI_SCN): New macro, containing the PRI* and SCN* parts
of gl_INTTYPES_H.
(gl_INTTYPES_H): Rewrite in terms of these new macros.
(gl_INTTYPES_H_DEFAULTS): Provide defaults for the PRI* and SCN*
parts, in case gl_INTTYPE_PRI_SCN is not invoked.
* modules/imaxabs, modules/imaxdiv, modules/strtoimax (Depends-on):
* modules/strtoumax, modules/xstrtol (Depends-on):
Depend on inttypes-incomplete, not inttypes.
* modules/inttypes-incomplete: New module, containing the contents
of the old modules/inttypes module, except that the Files: section
omits m4/inttypes-pri.m4, and the configure.ac section invokes
gl_INTTYPES_INCOMPLETE rather than gl_INTTYPES_H.
* modules/inttypes (Files): Remove lib/inttypes.in.h, m4/inttypes.m4.
(Depends-on): Depend only on inttypes-incomplete.
(Makefile.am): Remove everything; this is now in inttypes-incomplete.
Diffstat (limited to 'm4/inttypes.m4')
-rw-r--r-- | m4/inttypes.m4 | 29 |
1 files changed, 22 insertions, 7 deletions
diff --git a/m4/inttypes.m4 b/m4/inttypes.m4 index 99a60710d0..ee5bc1c723 100644 --- a/m4/inttypes.m4 +++ b/m4/inttypes.m4 @@ -1,4 +1,4 @@ -# inttypes.m4 serial 22 +# inttypes.m4 serial 23 dnl Copyright (C) 2006-2011 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -9,8 +9,13 @@ dnl Test whether <inttypes.h> is supported or must be substituted. AC_DEFUN([gl_INTTYPES_H], [ + AC_REQUIRE([gl_INTTYPES_INCOMPLETE]) + gl_INTTYPES_PRI_SCN +]) + +AC_DEFUN([gl_INTTYPES_INCOMPLETE], +[ AC_REQUIRE([gl_STDINT_H]) - AC_REQUIRE([gt_INTTYPES_PRI]) AC_CHECK_HEADERS_ONCE([inttypes.h]) dnl Override <inttypes.h> always, so that the portability warnings work. @@ -35,6 +40,17 @@ AC_DEFUN([gl_INTTYPES_H], #endif ]) + dnl Check for declarations of anything we want to poison if the + dnl corresponding gnulib module is not in use. + gl_WARN_ON_USE_PREPARE([[#include <inttypes.h> + ]], [imaxabs imaxdiv strtoimax strtoumax]) +]) + +# Ensure that the PRI* and SCN* macros are defined appropriately. +AC_DEFUN([gl_INTTYPES_PRI_SCN], +[ + AC_REQUIRE([gt_INTTYPES_PRI]) + PRIPTR_PREFIX= if test -n "$STDINT_H"; then dnl Using the gnulib <stdint.h>. It always defines intptr_t to 'long'. @@ -86,11 +102,6 @@ AC_DEFUN([gl_INTTYPES_H], else UINT64_MAX_EQ_ULONG_MAX=-1 fi - - dnl Check for declarations of anything we want to poison if the - dnl corresponding gnulib module is not in use. - gl_WARN_ON_USE_PREPARE([[#include <inttypes.h> - ]], [imaxabs imaxdiv strtoimax strtoumax]) ]) # Define the symbol $1 to be 1 if the condition is true, 0 otherwise. @@ -152,4 +163,8 @@ AC_DEFUN([gl_INTTYPES_H_DEFAULTS], HAVE_DECL_IMAXDIV=1; AC_SUBST([HAVE_DECL_IMAXDIV]) HAVE_DECL_STRTOIMAX=1; AC_SUBST([HAVE_DECL_STRTOIMAX]) HAVE_DECL_STRTOUMAX=1; AC_SUBST([HAVE_DECL_STRTOUMAX]) + INT64_MAX_EQ_LONG_MAX='defined _LP64'; AC_SUBST([INT64_MAX_EQ_LONG_MAX]) + PRI_MACROS_BROKEN=0; AC_SUBST([PRI_MACROS_BROKEN]) + PRIPTR_PREFIX=__PRIPTR_PREFIX; AC_SUBST([PRIPTR_PREFIX]) + UINT64_MAX_EQ_ULONG_MAX='defined _LP64'; AC_SUBST([UINT64_MAX_EQ_ULONG_MAX]) ]) |