]> sjero.net Git - wget/blobdiff - src/mswindows.c
[svn] Use strtoll on Windows if available (as with DMC).
[wget] / src / mswindows.c
index 93eb71d1ebe60950db34164b650e67d3fd505511..17d14a73e198ee3ed6d58e39f1abb191d763f2fe 100644 (file)
@@ -36,17 +36,6 @@ so, delete this exception statement from your version.  */
 #include <errno.h>
 #include <math.h>
 
-#ifdef HACK_BCC_UTIME_BUG
-# include <io.h>
-# include <fcntl.h>
-# ifdef HAVE_UTIME_H
-#  include <utime.h>
-# endif
-# ifdef HAVE_SYS_UTIME_H
-#  include <sys/utime.h>
-# endif
-#endif
-
 #define INHIBIT_WRAP /* avoid wrapping of socket, bind, ... */
 
 #include "wget.h"
@@ -77,13 +66,13 @@ xsleep (double seconds)
       sleep (seconds);
       seconds -= (long) seconds;
     }
-  usleep (seconds * 1000000L);
+  usleep (seconds * 1000000);
 #else  /* not HAVE_USLEEP */
   SleepEx ((DWORD) (seconds * 1000 + .5), FALSE);
 #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)
@@ -191,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)
@@ -606,34 +582,6 @@ ws_startup (void)
   set_sleep_mode ();
   SetConsoleCtrlHandler (ws_handler, TRUE);
 }
-
-/* Replacement utime function for buggy Borland C++Builder 5.5 compiler.
-   (The Borland utime function only works on Windows NT.)  */
-
-#ifdef HACK_BCC_UTIME_BUG
-int
-borland_utime (const char *path, const struct utimbuf *times)
-{
-  int fd;
-  int res;
-  struct ftime ft;
-  struct tm *ptr_tm;
-
-  if ((fd = open (path, O_RDWR)) < 0)
-    return -1;
-
-  ptr_tm = localtime (&times->modtime);
-  ft.ft_tsec = ptr_tm->tm_sec >> 1;
-  ft.ft_min = ptr_tm->tm_min;
-  ft.ft_hour = ptr_tm->tm_hour;
-  ft.ft_day = ptr_tm->tm_mday;
-  ft.ft_month = ptr_tm->tm_mon + 1;
-  ft.ft_year = ptr_tm->tm_year - 80;
-  res = setftime (fd, &ft);
-  close (fd);
-  return res;
-}
-#endif
 \f
 /* run_with_timeout Windows implementation.  */
 
@@ -709,7 +657,7 @@ run_with_timeout (double seconds, void (*fun) (void *), void *arg)
                             &thread_arg, 0, &thread_id);
   if (!thread_hnd)
     {
-      DEBUGP (("CreateThread() failed; %s\n", strerror (GetLastError ())));
+      DEBUGP (("CreateThread() failed; [0x%x]\n", GetLastError ()));
       goto blocking_fallback;
     }