]> sjero.net Git - wget/commitdiff
[svn] Use strtoll on Windows if available (as with DMC).
authorhniksic <devnull@localhost>
Wed, 6 Jul 2005 23:25:26 +0000 (16:25 -0700)
committerhniksic <devnull@localhost>
Wed, 6 Jul 2005 23:25:26 +0000 (16:25 -0700)
src/ChangeLog
src/mswindows.c
src/mswindows.h
windows/config-compiler.h

index ab03397b115d368d61f347bfa09ca9cc72f189dd..075f055bb407540c3214e6a6a652aeb1d78a5d9e 100644 (file)
@@ -1,3 +1,7 @@
+2005-07-06  Hrvoje Niksic  <hniksic@xemacs.org>
+
+       * mswindows.h: Use strtoll where available.
+
 2005-07-06  Hrvoje Niksic  <hniksic@xemacs.org>
 
        * sysdep.h: Add a full declaration of fnmatch.h.
index 4c77ab1c61b02041b37168d1ff2d16ca733ee09d..17d14a73e198ee3ed6d58e39f1abb191d763f2fe 100644 (file)
@@ -72,7 +72,7 @@ xsleep (double seconds)
 #endif /* not HAVE_USLEEP */
 }
 
-#if defined(__BORLANDC__) || (defined(_MSC_VER) && _MSC_VER < 1300)
+#if !defined(HAVE_STRTOLL) && !defined(HAVE__STRTOI64)
 
 static inline int
 char_value (char c, int base)
@@ -180,20 +180,7 @@ str_to_int64 (const char *nptr, char **endptr, int base)
     *endptr = (char *) nptr;
   return result;
 }
-
-#else  /* !defined(__BORLANDC__) && (!defined(_MSC_VER) || _MSC_VER >= 1300) */
-
-__int64
-str_to_int64 (const char *nptr, char **endptr, int base)
-{
-#ifdef _MSC_VER
-  return _strtoi64 (nptr, endptr, base);
-#else
-  return strtoll (nptr, endptr, base);
 #endif
-}
-
-#endif /* !defined(__BORLANDC__) && (!defined(_MSC_VER) || _MSC_VER >= 1300) */
 
 void
 windows_main (int *argc, char **argv, char **exec_name)
index 948d98396ef78fa57f7b5023adb7b3d737d67b3a..612dd94998c753409f6d514fa0491f8b2e90759a 100644 (file)
@@ -84,11 +84,15 @@ typedef __int64 wgint;
 #define WGINT_MAX LL (9223372036854775807)
 
 /* str_to_wgint is a function with the semantics of strtol, but which
-   works on wgint.  Since wgint is unconditionally 64-bit on Windows,
-   we #define it to str_to_int64, which either calls _strtoi64 or
-   implements the conversion manually.  */
-#define str_to_wgint str_to_int64
+   works on wgint.  */
+#if defined HAVE_STRTOLL
+# define str_to_wgint strtoll
+#elif defined HAVE__STRTOI64
+# define str_to_wgint _strtoi64
+#else
 __int64 str_to_int64 (const char *, char **, int);
+# define str_to_wgint str_to_int64
+#endif
 
 /* Windows has no symlink, therefore no lstat.  Without symlinks lstat
    is equivalent to stat anyway.  */
index 5ce1c9b81a9a58ffbd68b9043fa8d7d1e1ae258d..08bfa499ecfc619b358d22ad69f0b4b94b30f5f7 100644 (file)
@@ -95,6 +95,10 @@ so, delete this exception statement from your version.  */
 #define struct_fstat struct _stati64
 
 #define isatty _isatty
+
+#if _MSC_VER >= 1300
+# define HAVE__STRTOI64
+#endif
 \f
 /* ------------------ */
 /* Borland C section. */
@@ -126,6 +130,7 @@ so, delete this exception statement from your version.  */
 #define HAVE__BOOL 1
 #undef SIZEOF_LONG_LONG
 #define SIZEOF_LONG_LONG 8
+#define HAVE_STRTOLL
 \f
 #else
 # error Your compiler is not supported.