]> sjero.net Git - wget/commitdiff
[svn] Fixes to support out of the box compilation on various Windows compilers.
authorhniksic <devnull@localhost>
Thu, 25 Sep 2003 22:39:37 +0000 (15:39 -0700)
committerhniksic <devnull@localhost>
Thu, 25 Sep 2003 22:39:37 +0000 (15:39 -0700)
By Gisle Vanem.

ChangeLog
src/ChangeLog
src/mswindows.c
src/mswindows.h
windows/config.h.ms

index f6bcc6e63269eab80787177c3b5ec2a69b9efdf8..9aa113272c3e8136660fd547f1d03e9e51c7f643 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -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.
index 78c86a9bfaf876cf13856ae9b2d22fdcf8007b0c..ed573983dd1ca88a5271407d4a448677d38814ef 100644 (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
index 6cfc0555439e430822b50d7b7d9907922ce41a66..0b5242f15390760a8a777c4a6433c27fb37f2e4d 100644 (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);
index 72fe8e96abe2caad70185fcaa70e8c40ea35590d..4f505d8002f5ea3700e6b2ea7e9ef416755f4e40 100644 (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 */
index 32e94dfe55e541df7d24ea294c4dc7cb16bb1f69..8db2a46e5bc3be91dcd9a75d92ca71d944fb6042 100644 (file)
 /* 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 */