aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorPaul Eggert2013-10-12 13:00:38 -0700
committerPaul Eggert2013-10-12 13:00:38 -0700
commit46e5e833d91758f31fbbea3c894cd0c90e78c484 (patch)
treeada8756fe35e7b4c60b77a3344e3ec7beaecf11e /lib
parent2f4586ad044ba5deedadbccd4ad913c565ca3367 (diff)
downloademacs-46e5e833d91758f31fbbea3c894cd0c90e78c484.tar.gz
emacs-46e5e833d91758f31fbbea3c894cd0c90e78c484.zip
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.
Diffstat (limited to 'lib')
-rw-r--r--lib/gnulib.mk1
-rw-r--r--lib/inttypes.in.h16
-rw-r--r--lib/strtoimax.c15
3 files changed, 23 insertions, 9 deletions
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
565 -e 's/@''HAVE_DECL_STRTOIMAX''@/$(HAVE_DECL_STRTOIMAX)/g' \ 565 -e 's/@''HAVE_DECL_STRTOIMAX''@/$(HAVE_DECL_STRTOIMAX)/g' \
566 -e 's/@''HAVE_DECL_STRTOUMAX''@/$(HAVE_DECL_STRTOUMAX)/g' \ 566 -e 's/@''HAVE_DECL_STRTOUMAX''@/$(HAVE_DECL_STRTOUMAX)/g' \
567 -e 's/@''REPLACE_STRTOIMAX''@/$(REPLACE_STRTOIMAX)/g' \ 567 -e 's/@''REPLACE_STRTOIMAX''@/$(REPLACE_STRTOIMAX)/g' \
568 -e 's/@''REPLACE_STRTOUMAX''@/$(REPLACE_STRTOUMAX)/g' \
568 -e 's/@''INT32_MAX_LT_INTMAX_MAX''@/$(INT32_MAX_LT_INTMAX_MAX)/g' \ 569 -e 's/@''INT32_MAX_LT_INTMAX_MAX''@/$(INT32_MAX_LT_INTMAX_MAX)/g' \
569 -e 's/@''INT64_MAX_EQ_LONG_MAX''@/$(INT64_MAX_EQ_LONG_MAX)/g' \ 570 -e 's/@''INT64_MAX_EQ_LONG_MAX''@/$(INT64_MAX_EQ_LONG_MAX)/g' \
570 -e 's/@''UINT32_MAX_LT_UINTMAX_MAX''@/$(UINT32_MAX_LT_UINTMAX_MAX)/g' \ 571 -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 - "
1105#endif 1105#endif
1106 1106
1107#if @GNULIB_STRTOUMAX@ 1107#if @GNULIB_STRTOUMAX@
1108# if !@HAVE_DECL_STRTOUMAX@ 1108# if @REPLACE_STRTOUMAX@
1109# undef strtoumax 1109# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1110# undef strtoumax
1111# define strtoumax rpl_strtoumax
1112# endif
1113_GL_FUNCDECL_RPL (strtoumax, uintmax_t,
1114 (const char *, char **, int) _GL_ARG_NONNULL ((1)));
1115_GL_CXXALIAS_RPL (strtoumax, uintmax_t, (const char *, char **, int));
1116# else
1117# if !@HAVE_DECL_STRTOUMAX@
1118# undef strtoumax
1110_GL_FUNCDECL_SYS (strtoumax, uintmax_t, 1119_GL_FUNCDECL_SYS (strtoumax, uintmax_t,
1111 (const char *, char **, int) _GL_ARG_NONNULL ((1))); 1120 (const char *, char **, int) _GL_ARG_NONNULL ((1)));
1112# endif 1121# endif
1113_GL_CXXALIAS_SYS (strtoumax, uintmax_t, (const char *, char **, int)); 1122_GL_CXXALIAS_SYS (strtoumax, uintmax_t, (const char *, char **, int));
1123# endif
1114_GL_CXXALIASWARN (strtoumax); 1124_GL_CXXALIASWARN (strtoumax);
1115#elif defined GNULIB_POSIXCHECK 1125#elif defined GNULIB_POSIXCHECK
1116# undef strtoumax 1126# 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);
48#ifdef UNSIGNED 48#ifdef UNSIGNED
49# define Have_long_long HAVE_UNSIGNED_LONG_LONG_INT 49# define Have_long_long HAVE_UNSIGNED_LONG_LONG_INT
50# define Int uintmax_t 50# define Int uintmax_t
51# define Strtoimax strtoumax
52# define Strtol strtoul
53# define Strtoll strtoull
51# define Unsigned unsigned 54# define Unsigned unsigned
52# define strtoimax strtoumax
53# define strtol strtoul
54# define strtoll strtoull
55#else 55#else
56# define Have_long_long HAVE_LONG_LONG_INT 56# define Have_long_long HAVE_LONG_LONG_INT
57# define Int intmax_t 57# define Int intmax_t
58# define Strtoimax strtoimax
59# define Strtol strtol
60# define Strtoll strtoll
58# define Unsigned 61# define Unsigned
59#endif 62#endif
60 63
61Int 64Int
62strtoimax (char const *ptr, char **endptr, int base) 65Strtoimax (char const *ptr, char **endptr, int base)
63{ 66{
64#if Have_long_long 67#if Have_long_long
65 verify (sizeof (Int) == sizeof (Unsigned long int) 68 verify (sizeof (Int) == sizeof (Unsigned long int)
66 || sizeof (Int) == sizeof (Unsigned long long int)); 69 || sizeof (Int) == sizeof (Unsigned long long int));
67 70
68 if (sizeof (Int) != sizeof (Unsigned long int)) 71 if (sizeof (Int) != sizeof (Unsigned long int))
69 return strtoll (ptr, endptr, base); 72 return Strtoll (ptr, endptr, base);
70#else 73#else
71 verify (sizeof (Int) == sizeof (Unsigned long int)); 74 verify (sizeof (Int) == sizeof (Unsigned long int));
72#endif 75#endif
73 76
74 return strtol (ptr, endptr, base); 77 return Strtol (ptr, endptr, base);
75} 78}