bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

inttypes: modernize


From: Bruno Haible
Subject: inttypes: modernize
Date: Thu, 05 Jan 2012 18:43:21 +0100
User-agent: KMail/4.7.4 (Linux/3.1.0-1.2-desktop; KDE/4.7.4; x86_64; ; )

A small modernization. A preparation for the next patch.


2012-01-05  Bruno Haible  <address@hidden>

        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.

--- lib/inttypes.in.h.orig      Thu Jan  5 18:40:38 2012
+++ lib/inttypes.in.h   Thu Jan  5 18:39:44 2012
@@ -56,6 +56,8 @@
 # error "This file assumes that 'int' has exactly 32 bits. Please report your 
platform and compiler to <address@hidden>."
 #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 address@hidden@
 #  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 address@hidden@
 #  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
--- modules/inttypes-incomplete.orig    Thu Jan  5 18:40:38 2012
+++ modules/inttypes-incomplete Thu Jan  5 18:40:22 2012
@@ -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 <inttypes.h> 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 address@hidden $@ && \
        { 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; \




reply via email to

[Prev in Thread] Current Thread [Next in Thread]