]> Dogcows Code - chaz/tar/commitdiff
(HAVE_LONG_LONG): Redefine to HAVE_UNSIGNED_LONG_LONG if unsigned.
authorPaul Eggert <eggert@cs.ucla.edu>
Thu, 6 Sep 2001 19:47:45 +0000 (19:47 +0000)
committerPaul Eggert <eggert@cs.ucla.edu>
Thu, 6 Sep 2001 19:47:45 +0000 (19:47 +0000)
(strtoimax): Use sizeof (long), not sizeof strtol (ptr, endptr, base),
to work around bug in IBM C compiler.

lib/strtoimax.c

index cda6b44d0d875a64e85079e78e21f7a04e6cce94..0f03ca174b7826ab70ac80634d648433d9a89183 100644 (file)
@@ -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);
This page took 0.029841 seconds and 4 git commands to generate.