# HG changeset patch # User Bruno Haible # Date 1325785328 -3600 # Node ID daac1ca4c4365955c767fed46acaf9567925f881 # Parent 4adb73653ffa0a7dcc97a89f5b438bef32ea5787 inttypes: Modernize. * lib/inttypes.in.h (strtoimax, strtoumax): Use the C++ safe idioms. * modules/inttypes-incomplete (Depends-on): Add snippet/c++defs. (Makefile.am): Update inttypes.h rule. diff --git a/ChangeLog b/ChangeLog --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2012-01-05 Bruno Haible + + inttypes: Modernize. + * lib/inttypes.in.h (strtoimax, strtoumax): Use the C++ safe idioms. + * modules/inttypes-incomplete (Depends-on): Add snippet/c++defs. + (Makefile.am): Update inttypes.h rule. + 2012-01-05 Jim Meyering init.sh: don't waste a subshell just to redirect stderr diff --git a/lib/inttypes.in.h b/lib/inttypes.in.h --- a/lib/inttypes.in.h +++ b/lib/inttypes.in.h @@ -56,6 +56,8 @@ # error "This file assumes that 'int' has exactly 32 bits. Please report your platform and compiler to ." #endif +/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */ + /* The definition of _GL_ARG_NONNULL is copied here. */ /* The definition of _GL_WARN_ON_USE is copied here. */ @@ -1079,8 +1081,11 @@ #if @GNULIB_STRTOIMAX@ # if !@HAVE_DECL_STRTOIMAX@ # undef strtoimax -extern intmax_t strtoimax (const char *, char **, int) _GL_ARG_NONNULL ((1)); +_GL_FUNCDECL_SYS (strtoimax, intmax_t, + (const char *, char **, int) _GL_ARG_NONNULL ((1))); # endif +_GL_CXXALIAS_SYS (strtoimax, intmax_t, (const char *, char **, int)); +_GL_CXXALIASWARN (strtoimax); #elif defined GNULIB_POSIXCHECK # undef strtoimax # if HAVE_RAW_DECL_STRTOIMAX @@ -1092,8 +1097,11 @@ #if @GNULIB_STRTOUMAX@ # if !@HAVE_DECL_STRTOUMAX@ # undef strtoumax -extern uintmax_t strtoumax (const char *, char **, int) _GL_ARG_NONNULL ((1)); +_GL_FUNCDECL_SYS (strtoumax, uintmax_t, + (const char *, char **, int) _GL_ARG_NONNULL ((1))); # endif +_GL_CXXALIAS_SYS (strtoumax, uintmax_t, (const char *, char **, int)); +_GL_CXXALIASWARN (strtoumax); #elif defined GNULIB_POSIXCHECK # undef strtoumax # if HAVE_RAW_DECL_STRTOUMAX diff --git a/modules/inttypes-incomplete b/modules/inttypes-incomplete --- a/modules/inttypes-incomplete +++ b/modules/inttypes-incomplete @@ -9,6 +9,7 @@ include_next multiarch snippet/arg-nonnull +snippet/c++defs snippet/warn-on-use stdint @@ -20,7 +21,7 @@ # We need the following in order to create when the system # doesn't have one that works with the given compiler. -inttypes.h: inttypes.in.h $(top_builddir)/config.status $(WARN_ON_USE_H) $(ARG_NONNULL_H) +inttypes.h: inttypes.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_USE_H) $(ARG_NONNULL_H) $(AM_V_GEN)rm -f $@-t $@ && \ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ sed -e 's/@''HAVE_INTTYPES_H''@/$(HAVE_INTTYPES_H)/g' \ @@ -45,6 +46,7 @@ -e 's/@''INT64_MAX_EQ_LONG_MAX''@/$(INT64_MAX_EQ_LONG_MAX)/g' \ -e 's/@''UINT32_MAX_LT_UINTMAX_MAX''@/$(UINT32_MAX_LT_UINTMAX_MAX)/g' \ -e 's/@''UINT64_MAX_EQ_ULONG_MAX''@/$(UINT64_MAX_EQ_ULONG_MAX)/g' \ + -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \ -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \ < $(srcdir)/inttypes.in.h; \