]> sjero.net Git - wget/commitdiff
[svn] Windows fixes by Herold Heiko.
authorhniksic <devnull@localhost>
Thu, 29 Nov 2001 14:15:11 +0000 (06:15 -0800)
committerhniksic <devnull@localhost>
Thu, 29 Nov 2001 14:15:11 +0000 (06:15 -0800)
src/ChangeLog
src/cmpt.c
src/mswindows.c
src/mswindows.h
windows/Makefile.src
windows/Makefile.src.bor
windows/config.h.bor
windows/config.h.ms

index 94e912c2ca4377033f3b805dc293ee94c7136fcb..fdb0ec9d62b4a43dcd5404d31b4ea6d92821a1a4 100644 (file)
@@ -1,3 +1,11 @@
+2001-01-23  Herold Heiko  <Heiko.Herold@previnet.it>
+
+       * config.h.ms, mswindows.h: defined HAVE_ISATTY, use _isatty for
+       MS VC; somebody with Borland compiler please check and provide
+       patch if possible;
+
+       * cmpt.c: provided a usleep emulation.
+
 2001-11-29  Hrvoje Niksic  <hniksic@arsdigita.com>
 
        * host.c (address_list_new): Initialize al->faulty.
index 7a7add09bd607da57a3b908c5c73b3e1d8ea9d59..6fb7fc0413442c82a406ee53f304fdc781b5902b 100644 (file)
@@ -1209,8 +1209,10 @@ strptime (buf, format, tm)
 
 
 #ifndef HAVE_USLEEP
-/* A simple usleep implementation based on select().  This will
-   probably not work on Windows.  */
+#ifndef WINDOWS
+
+/* A simple usleep implementation based on select().  For Unix and
+   Unix-like systems.  */
 
 int
 usleep (unsigned long usec)
@@ -1221,4 +1223,6 @@ usleep (unsigned long usec)
   select (0, NULL, NULL, NULL, &tm);
   return 0;
 }
+
+#endif /* not WINDOWS */
 #endif /* not HAVE_USLEEP */
index 178b923119709433d09534e65ef4a2b75637aa4a..6353cc280b48f18d2acad96c190aba9189554ccd 100644 (file)
@@ -42,12 +42,29 @@ static int windows_nt_p;
 
 
 /* Emulation of Unix sleep.  */
+
 unsigned int
 sleep (unsigned seconds)
 {
   return SleepEx (1000 * seconds, TRUE) ? 0U : 1000 * seconds;
 }
 
+/* Emulation of Unix usleep().  This has a granularity of
+   milliseconds, but that's ok because:
+
+   a) Wget is only using it with milliseconds;
+
+   b) You can't rely on usleep's granularity anyway.  If a caller
+   expects usleep to respect every microsecond, he's in for a
+   surprise.  */
+
+int
+usleep (unsigned long usec)
+{
+  SleepEx (usec / 1000, TRUE);
+  return 0;
+}
+
 static char *
 read_registry (HKEY hkey, char *subkey, char *valuename, char *buf, int *len)
 {
index 3c4a76b018c7426f8ff92b17f2c09617d81ccc32..fb96317b5fc64f59331d6b2f33304b9c2f52f21c 100644 (file)
@@ -48,6 +48,13 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
 # define stat _stat
 #endif
 
+#ifdef HAVE_ISATTY
+/* Microsoft VC supports _isatty; Borland ? */
+#ifdef _MSC_VER
+# define isatty _isatty
+#endif
+#endif
+
 #define REALCLOSE(x) closesocket (x)
 
 /* read & write don't work with sockets on Windows 95.  */
index bac24096106f69ad1c61196f393790f98165e889..35c7c847771695a649d86f87bcaf9f98ea2e77f5 100644 (file)
@@ -54,13 +54,13 @@ RM      = del
 
 SRC = cmpt.c safe-ctype.c connect.c host.c http.c netrc.c ftp-basic.c ftp.c \
       ftp-ls.c ftp-opie.c getopt.c hash.c headers.c html-parse.c html-url.c \
-      retr.c recur.c res.c url.c cookies.c init.c utils.c main.c version.c \
-      mswindows.c fnmatch.c gnu-md5.c rbuf.c log.c $(SSLSRC)
+      progress.c retr.c recur.c res.c url.c cookies.c init.c utils.c main.c \
+      version.c mswindows.c fnmatch.c gnu-md5.c rbuf.c log.c $(SSLSRC)
 
 OBJ = cmpt$o safe-ctype$o connect$o host$o http$o netrc$o ftp-basic$o ftp$o \
       ftp-ls$o ftp-opie$o getopt$o hash$o headers$o html-parse$o html-url$o \
-      retr$o recur$o res$o url$o cookies$o init$o utils$o main$o version$o \
-      mswindows$o fnmatch$o gnu-md5$o rbuf$o log$o $(SSLOBJ)
+      progress$o retr$o recur$o res$o url$o cookies$o init$o utils$o main$o \
+      version$o mswindows$o fnmatch$o gnu-md5$o rbuf$o log$o $(SSLOBJ)
 
 .SUFFIXES: .c .obj
 
index b3b2818a3681b4a9e5685b50f839ed6692cd796d..9608c30dee314f590611cb8ff64eeddd9155817c 100644 (file)
@@ -28,6 +28,7 @@ retr.obj+
 res.obj+
 recur.obj+
 rbuf.obj+
+progress.obj+
 netrc.obj+
 mswindows.obj+
 gnu-md5.obj+
index c718cf678cb8d2add5706218d9e39cf028809717..44491a9d0a8e7ffa2c964e36c92c7fe6079a5fcd 100644 (file)
@@ -176,4 +176,8 @@ char *alloca ();
 /* Define if we're using builtin (GNU) md5.c.  */
 #define HAVE_BUILTIN_MD5 1
 
+/* Define if you have the isatty function.  */
+#undef HAVE_ISATTY
+
+
 #endif /* CONFIG_H */
index 6d7471102fde08dea5cef7e2ff7abfae838c9f94..5078bd6735e701dbff3cffc7f7192c750d2676eb 100644 (file)
@@ -186,5 +186,8 @@ char *alloca ();
 #define inline __inline
 #define ftruncate chsize
 
+/* Define if you have the isatty function.  */
+#define HAVE_ISATTY 1
+
 #endif /* CONFIG_H */