1
0
mirror of https://github.com/moparisthebest/wget synced 2024-07-03 16:38:41 -04:00

[svn] Fixes to support out of the box compilation on various Windows compilers.

By Gisle Vanem.
This commit is contained in:
hniksic 2003-09-25 15:39:37 -07:00
parent d0c4347710
commit 700df4394e
5 changed files with 49 additions and 7 deletions

View File

@ -1,3 +1,11 @@
2003-09-26 Gisle Vanem <giva@bgnett.no>
* windows/config.h.ms: Don't declare alloca under compilers that
support it.
* windows/config.h.ms: Define HAVE_SNPRINTF, HAVE_VSNPRINTF, and
HAVE_MEMMOVE.
2003-09-25 Herold Heiko <Heiko.Herold@previnet.it>
* windows/Makefile.src: Updated OBJ list.

View File

@ -1,3 +1,12 @@
2003-09-26 Gisle Vanem <giva@bgnett.no>
* mswindows.c (read_registry): Fix invocation of registry
functions.
* mswindows.c (read_registry): Condition definitions of sleep and
usleep with not HAVE_SLEEP and HAVE_USLEEP respectively. Define
HAVE_SLEEP and HAVE_USLEEP under __DMC__.
2003-09-24 Hrvoje Niksic <hniksic@xemacs.org>
* url.c (url_escape_1): Revert unintentional change to lowercase

View File

@ -63,6 +63,7 @@ void log_request_redirect_output PARAMS ((const char *));
static int windows_nt_p;
#ifndef HAVE_SLEEP
/* Emulation of Unix sleep. */
unsigned int
@ -70,7 +71,9 @@ sleep (unsigned seconds)
{
return SleepEx (1000 * seconds, TRUE) ? 0U : 1000 * seconds;
}
#endif
#ifndef HAVE_USLEEP
/* Emulation of Unix usleep(). This has a granularity of
milliseconds, but that's ok because:
@ -87,6 +90,7 @@ usleep (unsigned long usec)
SleepEx (usec / 1000, TRUE);
return 0;
}
#endif /* HAVE_USLEEP */
static char *
read_registry (HKEY hkey, char *subkey, char *valuename, char *buf, int *len)
@ -94,9 +98,9 @@ read_registry (HKEY hkey, char *subkey, char *valuename, char *buf, int *len)
HKEY result;
DWORD size = *len;
DWORD type = REG_SZ;
if (RegOpenKeyEx (hkey, subkey, NULL, KEY_READ, &result) != ERROR_SUCCESS)
if (RegOpenKeyEx (hkey, subkey, 0, KEY_READ, &result) != ERROR_SUCCESS)
return NULL;
if (RegQueryValueEx (result, valuename, NULL, &type, buf, &size) != ERROR_SUCCESS)
if (RegQueryValueEx (result, valuename, NULL, &type, (LPBYTE)buf, &size) != ERROR_SUCCESS)
buf = NULL;
*len = size;
RegCloseKey (result);

View File

@ -125,14 +125,24 @@ so, delete this exception statement from your version. */
#define ESTALE WSAESTALE
#define EREMOTE WSAEREMOTE
#ifdef __DMC__
# define HAVE_SLEEP 1
# define HAVE_USLEEP 1
#endif
/* Public functions. */
#ifndef HAVE_SLEEP
unsigned int sleep (unsigned);
#endif
#ifndef HAVE_USLEEP
int usleep (unsigned long);
#endif
void ws_startup (void);
void ws_changetitle (char*, int);
char *ws_mypath (void);
void ws_help (const char *);
void windows_main_junk (int *, char **, char **);
int usleep (unsigned long);
#endif /* MSWINDOWS_H */

View File

@ -32,8 +32,10 @@
/* Define if you have the <alloca.h> header file. */
#undef HAVE_ALLOCA_H
#if !defined(__GNUC__) && !defined(__DMC__) && !defined(__WATCOMC__)
/* Microsoft and Watcom libraries have an alloca function. */
char *alloca ();
#endif
/* Define to empty if the keyword does not work. */
/* #undef const */
@ -97,10 +99,10 @@ char *alloca ();
#define HAVE_STRERROR 1
/* Define if you have the snprintf function. */
#undef HAVE_SNPRINTF
#define HAVE_SNPRINTF
/* Define if you have the vsnprintf function. */
#undef HAVE_VSNPRINTF
#define HAVE_VSNPRINTF
/* Define if you have the strstr function. */
#define HAVE_STRSTR 1
@ -133,8 +135,14 @@ char *alloca ();
#define HAVE_STRING_H 1
/* Define if you have the <unistd.h> header file. */
/* #define HAVE_UNISTD_H 1 */
#if !defined(_MSC_VER)
#undef HAVE_UNISTD_H
#endif
/* None except Digital Mars have usleep function */
#if defined(__DMC__)
#define HAVE_USLEEP
#endif
/* Define if you have the <utime.h> header file. */
#undef HAVE_UTIME_H
@ -149,7 +157,7 @@ char *alloca ();
#undef HAVE_PWD_H
/* Define if you have the <signal.h> header file. */
#undef HAVE_SIGNAL_H
#define HAVE_SIGNAL_H
/* Define to be the name of the operating system. */
#define OS_TYPE "Windows"
@ -178,5 +186,8 @@ char *alloca ();
/* Define if you have the isatty function. */
#define HAVE_ISATTY 1
/* Define if you have the memmove function */
#define HAVE_MEMMOVE 1
#endif /* CONFIG_H */