From 46e5e833d91758f31fbbea3c894cd0c90e78c484 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sat, 12 Oct 2013 13:00:38 -0700 Subject: Merge from gnulib. This incorporates: 2013-10-10 strtoumax: port to Solaris 8 2013-10-09 strtoimax, strtoumax: port to HP-UX 11.11 * lib/gnulib.mk, m4/gnulib-comp.m4: Regenerate. * lib/inttypes.in.h, lib/strtoimax.c, m4/inttypes.m4, m4/strtoimax.m4: * m4/strtoumax.m4: Update from gnulib. --- lib/gnulib.mk | 1 + lib/inttypes.in.h | 16 +++++++++++++--- lib/strtoimax.c | 15 +++++++++------ 3 files changed, 23 insertions(+), 9 deletions(-) (limited to 'lib') diff --git a/lib/gnulib.mk b/lib/gnulib.mk index 69fc06bbe06..44cdc0cdaac 100644 --- a/lib/gnulib.mk +++ b/lib/gnulib.mk @@ -565,6 +565,7 @@ inttypes.h: inttypes.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_U -e 's/@''HAVE_DECL_STRTOIMAX''@/$(HAVE_DECL_STRTOIMAX)/g' \ -e 's/@''HAVE_DECL_STRTOUMAX''@/$(HAVE_DECL_STRTOUMAX)/g' \ -e 's/@''REPLACE_STRTOIMAX''@/$(REPLACE_STRTOIMAX)/g' \ + -e 's/@''REPLACE_STRTOUMAX''@/$(REPLACE_STRTOUMAX)/g' \ -e 's/@''INT32_MAX_LT_INTMAX_MAX''@/$(INT32_MAX_LT_INTMAX_MAX)/g' \ -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' \ diff --git a/lib/inttypes.in.h b/lib/inttypes.in.h index 1893f5569d3..05a22fff790 100644 --- a/lib/inttypes.in.h +++ b/lib/inttypes.in.h @@ -1105,12 +1105,22 @@ _GL_WARN_ON_USE (strtoimax, "strtoimax is unportable - " #endif #if @GNULIB_STRTOUMAX@ -# if !@HAVE_DECL_STRTOUMAX@ -# undef strtoumax +# if @REPLACE_STRTOUMAX@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef strtoumax +# define strtoumax rpl_strtoumax +# endif +_GL_FUNCDECL_RPL (strtoumax, uintmax_t, + (const char *, char **, int) _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL (strtoumax, uintmax_t, (const char *, char **, int)); +# else +# if !@HAVE_DECL_STRTOUMAX@ +# undef strtoumax _GL_FUNCDECL_SYS (strtoumax, uintmax_t, (const char *, char **, int) _GL_ARG_NONNULL ((1))); -# endif +# endif _GL_CXXALIAS_SYS (strtoumax, uintmax_t, (const char *, char **, int)); +# endif _GL_CXXALIASWARN (strtoumax); #elif defined GNULIB_POSIXCHECK # undef strtoumax diff --git a/lib/strtoimax.c b/lib/strtoimax.c index c9bd2ad3b1c..b4feaf361f7 100644 --- a/lib/strtoimax.c +++ b/lib/strtoimax.c @@ -48,28 +48,31 @@ long long int strtoll (char const *, char **, int); #ifdef UNSIGNED # define Have_long_long HAVE_UNSIGNED_LONG_LONG_INT # define Int uintmax_t +# define Strtoimax strtoumax +# define Strtol strtoul +# define Strtoll strtoull # define Unsigned unsigned -# define strtoimax strtoumax -# define strtol strtoul -# define strtoll strtoull #else # define Have_long_long HAVE_LONG_LONG_INT # define Int intmax_t +# define Strtoimax strtoimax +# define Strtol strtol +# define Strtoll strtoll # define Unsigned #endif Int -strtoimax (char const *ptr, char **endptr, int base) +Strtoimax (char const *ptr, char **endptr, int base) { #if Have_long_long verify (sizeof (Int) == sizeof (Unsigned long int) || sizeof (Int) == sizeof (Unsigned long long int)); if (sizeof (Int) != sizeof (Unsigned long int)) - return strtoll (ptr, endptr, base); + return Strtoll (ptr, endptr, base); #else verify (sizeof (Int) == sizeof (Unsigned long int)); #endif - return strtol (ptr, endptr, base); + return Strtol (ptr, endptr, base); } -- cgit v1.2.1