X-Git-Url: https://erislabs.net/gitweb/?a=blobdiff_plain;f=m4%2Finttypes.m4;h=3b483d39f5cf3c4981b039dbe16e9f581d9f5a8f;hb=9fc81090f6c5590bd1b0e0fa5087577a2ee43a3e;hp=5cc042a7041a241120c784f650d2357004a8c2b4;hpb=b2346264de7b3b73945a1a9a84af82f5bc2960d3;p=gnulib.git diff --git a/m4/inttypes.m4 b/m4/inttypes.m4 index 5cc042a70..3b483d39f 100644 --- a/m4/inttypes.m4 +++ b/m4/inttypes.m4 @@ -1,5 +1,5 @@ -# inttypes.m4 serial 20 -dnl Copyright (C) 2006-2011 Free Software Foundation, Inc. +# inttypes.m4 serial 26 +dnl Copyright (C) 2006-2013 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -9,12 +9,14 @@ dnl Test whether is supported or must be substituted. AC_DEFUN([gl_INTTYPES_H], [ + AC_REQUIRE([gl_INTTYPES_INCOMPLETE]) + gl_INTTYPES_PRI_SCN +]) + +AC_DEFUN_ONCE([gl_INTTYPES_INCOMPLETE], +[ AC_REQUIRE([gl_STDINT_H]) - AC_REQUIRE([gt_INTTYPES_PRI]) AC_CHECK_HEADERS_ONCE([inttypes.h]) - AC_CHECK_DECLS_ONCE([imaxdiv]) - AC_CHECK_DECLS_ONCE([strtoimax]) - AC_CHECK_DECLS_ONCE([strtoumax]) dnl Override always, so that the portability warnings work. AC_REQUIRE([gl_INTTYPES_H_DEFAULTS]) @@ -22,22 +24,17 @@ AC_DEFUN([gl_INTTYPES_H], AC_REQUIRE([gl_MULTIARCH]) - dnl Ensure that defines the limit macros, since gnulib's - dnl relies on them. This macro is only needed when a - dnl C++ compiler is in use; it has no effect for a C compiler. - dnl Also be careful to define __STDC_LIMIT_MACROS only when gnulib's - dnl is going to be created, and to avoid redefinition warnings - dnl if the __STDC_LIMIT_MACROS is already defined through the CPPFLAGS. - AC_DEFINE([GL_TRIGGER_STDC_LIMIT_MACROS], [1], - [Define to make the limit macros in visible.]) - AH_VERBATIM([__STDC_LIMIT_MACROS_ZZZ], -[/* Ensure that defines the limit macros, since gnulib's - relies on them. */ -#if defined __cplusplus && !defined __STDC_LIMIT_MACROS && GL_TRIGGER_STDC_LIMIT_MACROS -# define __STDC_LIMIT_MACROS 1 -#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 + ]], [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 . It always defines intptr_t to 'long'. @@ -61,24 +58,6 @@ AC_DEFUN([gl_INTTYPES_H], fi AC_SUBST([PRIPTR_PREFIX]) - if test "$ac_cv_have_decl_imaxdiv" = yes; then - HAVE_DECL_IMAXDIV=1 - else - HAVE_DECL_IMAXDIV=0 - fi - - if test "$ac_cv_have_decl_strtoimax" = yes; then - HAVE_DECL_STRTOIMAX=1 - else - HAVE_DECL_STRTOIMAX=0 - fi - - if test "$ac_cv_have_decl_strtoumax" = yes; then - HAVE_DECL_STRTOUMAX=1 - else - HAVE_DECL_STRTOUMAX=0 - fi - gl_INTTYPES_CHECK_LONG_LONG_INT_CONDITION( [INT32_MAX_LT_INTMAX_MAX], [defined INT32_MAX && defined INTMAX_MAX], @@ -107,11 +86,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 - ]], [imaxabs imaxdiv strtoimax strtoumax]) ]) # Define the symbol $1 to be 1 if the condition is true, 0 otherwise. @@ -173,4 +147,11 @@ 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]) + REPLACE_STRTOIMAX=0; AC_SUBST([REPLACE_STRTOIMAX]) + INT32_MAX_LT_INTMAX_MAX=1; AC_SUBST([INT32_MAX_LT_INTMAX_MAX]) + 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]) + UINT32_MAX_LT_UINTMAX_MAX=1; AC_SUBST([UINT32_MAX_LT_UINTMAX_MAX]) + UINT64_MAX_EQ_ULONG_MAX='defined _LP64'; AC_SUBST([UINT64_MAX_EQ_ULONG_MAX]) ])