Mercurial > hg > octave-kai > gnulib-hg
changeset 3481:1715aaf925e7
(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.
author | Jim Meyering <jim@meyering.net> |
---|---|
date | Mon, 17 Sep 2001 10:24:20 +0000 |
parents | f174876eaf3b |
children | f16f37022ead |
files | lib/strtoimax.c |
diffstat | 1 files changed, 7 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/lib/strtoimax.c +++ b/lib/strtoimax.c @@ -71,6 +71,8 @@ #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 @@ 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);