diff options
author | Jim Meyering <jim@meyering.net> | 2001-09-17 10:24:20 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 2001-09-17 10:24:20 +0000 |
commit | d6e1aff5e6b950bfe81a9d2efc7e483f9367a2c2 (patch) | |
tree | 32dfd509678d4ee1bf971b2d46ebca2d92eb4cfb | |
parent | 81c488fe625d48ccb626b0720c3aa6abfb46a9ca (diff) | |
download | coreutils-d6e1aff5e6b950bfe81a9d2efc7e483f9367a2c2.tar.xz |
(HAVE_LONG_LONG): Redefine to HAVE_UNSIGNED_LONG_LONG if unsigned.
(strtoimax): Use sizeof (long), not sizeof strtol (ptr, endptr, base),
to work around bug in IBM C compiler.
-rw-r--r-- | lib/strtoimax.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/lib/strtoimax.c b/lib/strtoimax.c index cda6b44d0..0f03ca174 100644 --- a/lib/strtoimax.c +++ b/lib/strtoimax.c @@ -71,6 +71,8 @@ long long strtoll PARAMS ((char const *, char **, int)); #endif #ifdef UNSIGNED +# undef HAVE_LONG_LONG +# define HAVE_LONG_LONG HAVE_UNSIGNED_LONG_LONG # define INT uintmax_t # define strtoimax strtoumax # define strtol strtoul @@ -82,16 +84,16 @@ long long strtoll PARAMS ((char const *, char **, int)); INT strtoimax (char const *ptr, char **endptr, int base) { -#if HAVE_UNSIGNED_LONG_LONG +#if HAVE_LONG_LONG verify (size_is_that_of_long_or_long_long, - (sizeof (INT) == sizeof strtol (ptr, endptr, base) - || sizeof (INT) == sizeof strtoll (ptr, endptr, base))); + (sizeof (INT) == sizeof (long) + || sizeof (INT) == sizeof (long long))); - if (sizeof (INT) != sizeof strtol (ptr, endptr, base)) + if (sizeof (INT) != sizeof (long)) return strtoll (ptr, endptr, base); #else verify (size_is_that_of_long, - sizeof (INT) == sizeof strtol (ptr, endptr, base)); + sizeof (INT) == sizeof (long)); #endif return strtol (ptr, endptr, base); |