[svn] Windows fixes by Herold Heiko.

This commit is contained in:
hniksic 2001-11-29 06:15:11 -08:00
parent bb8e524316
commit 9c1c7f27cd
8 changed files with 50 additions and 6 deletions

View 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.

View 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 */

View 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)
{

View 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. */

View 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

View File

@ -28,6 +28,7 @@ retr.obj+
res.obj+
recur.obj+
rbuf.obj+
progress.obj+
netrc.obj+
mswindows.obj+
gnu-md5.obj+

View 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 */

View 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 */