]> Savannah Git Hosting - gnulib.git/commitdiff
strtoll, strtoull: Rely on limits-h module.
authorBruno Haible <bruno@clisp.org>
Thu, 6 Sep 2018 12:41:00 +0000 (14:41 +0200)
committerBruno Haible <bruno@clisp.org>
Thu, 6 Sep 2018 12:41:00 +0000 (14:41 +0200)
* lib/strtol.c (TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Remove macros.
(ULLONG_MAX, LLONG_MAX, LLONG_MIN): Remove fallback definitions.
* modules/strtoll (Depends-on): Add limits-h.
* modules/strtoull (Depends-on): Likewise.

ChangeLog
lib/strtol.c
modules/strtoll
modules/strtoull

index 3166c7ccbf15bd1ef771cf9a6b547e22aa56ab07..4116600e5ee411125e5f0660f2816b0978b41f70 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2018-09-06  Bruno Haible  <bruno@clisp.org>
+
+       strtoll, strtoull: Rely on limits-h module.
+       * lib/strtol.c (TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Remove macros.
+       (ULLONG_MAX, LLONG_MAX, LLONG_MIN): Remove fallback definitions.
+       * modules/strtoll (Depends-on): Add limits-h.
+       * modules/strtoull (Depends-on): Likewise.
+
 2018-09-06  Bruno Haible  <bruno@clisp.org>
 
        intprops tests: Fix compilation error with pre-C99 compiler.
index 55871b4c78c15fbcb4a48b332fd6f4440ef4143b..f6f5c3268de0e5fa93ffa86e24709d421aee0b2a 100644 (file)
 # define STRTOL_LONG_MIN LLONG_MIN
 # define STRTOL_LONG_MAX LLONG_MAX
 # define STRTOL_ULONG_MAX ULLONG_MAX
-
-/* The extra casts in the following macros work around compiler bugs,
-   e.g., in Cray C 5.0.3.0.  */
-
-/* True if the arithmetic type T is signed.  */
-# define TYPE_SIGNED(t) (! ((t) 0 < (t) -1))
-
-/* Minimum and maximum values for integer types.
-   These macros have undefined behavior for signed types that either
-   have padding bits or do not use two's complement.  If this is a
-   problem for you, please let us know how to fix it for your host.  */
-
-/* The maximum and minimum values for the integer type T.  */
-# define TYPE_MINIMUM(t) ((t) ~ TYPE_MAXIMUM (t))
-# define TYPE_MAXIMUM(t)                                                 \
-   ((t) (! TYPE_SIGNED (t)                                               \
-         ? (t) -1                                                        \
-         : ((((t) 1 << (sizeof (t) * CHAR_BIT - 2)) - 1) * 2 + 1)))
-
-# ifndef ULLONG_MAX
-#  define ULLONG_MAX TYPE_MAXIMUM (unsigned long long)
-# endif
-# ifndef LLONG_MAX
-#  define LLONG_MAX TYPE_MAXIMUM (long long int)
-# endif
-# ifndef LLONG_MIN
-#  define LLONG_MIN TYPE_MINIMUM (long long int)
-# endif
-
 # if __GNUC__ == 2 && __GNUC_MINOR__ < 7
    /* Work around gcc bug with using this constant.  */
    static const unsigned long long int maxquad = ULLONG_MAX;
index 5501fdac3b4d85e8c277f988bb7de19f58984e22..082d7f4ee5b97d3a3b0258db401b7cdd7a916237 100644 (file)
@@ -8,6 +8,7 @@ m4/longlong.m4
 m4/strtoll.m4
 
 Depends-on:
+limits-h
 stdlib
 
 configure.ac:
index 6bb66fea225ea145ff029e7ae48438ba463c30a9..7f94bcab615bab64a87c5dcde8ba311af697063e 100644 (file)
@@ -9,6 +9,7 @@ m4/longlong.m4
 m4/strtoull.m4
 
 Depends-on:
+limits-h
 stdlib
 
 configure.ac: