The code in the windows that #defines __STDC__ against the compiler's
will gives me the creeps.  I think this patch is a cleaner way to
accomplish the same.  Please let me know if it works under Windows.

top-level ChangeLog:
2002-05-20  Hrvoje Niksic  <[EMAIL PROTECTED]>

        * windows/config.h.ms: Ditto.

        * windows/config.h.bor: Don't #define __STDC__.

src/ChangeLog:
2002-05-20  Hrvoje Niksic  <[EMAIL PROTECTED]>

        * log.c: Don't #undef WGET_USE_STDARG.

Index: src/log.c
===================================================================
RCS file: /pack/anoncvs/wget/src/log.c,v
retrieving revision 1.14
diff -u -r1.14 log.c
--- src/log.c   2002/05/18 02:16:23     1.14
+++ src/log.c   2002/05/20 00:36:29
@@ -29,15 +29,18 @@
 
 #include <config.h>
 
+/* This allows the architecture-specific .h files to specify the use
+   of stdargs regardless of __STDC__.  */
+#ifndef WGET_USE_STDARG
 /* Use stdarg only if the compiler supports ANSI C and stdarg.h is
    present.  We check for both because there are configurations where
    stdarg.h exists, but doesn't work. */
-#undef WGET_USE_STDARG
-#ifdef __STDC__
-# ifdef HAVE_STDARG_H
-#  define WGET_USE_STDARG
+# ifdef __STDC__
+#  ifdef HAVE_STDARG_H
+#   define WGET_USE_STDARG
+#  endif
 # endif
-#endif
+#endif /* not WGET_USE_STDARG */
 
 #include <stdio.h>
 #ifdef HAVE_STRING_H
Index: src/mswindows.h
===================================================================
RCS file: /pack/anoncvs/wget/src/mswindows.h,v
retrieving revision 1.6
diff -u -r1.6 mswindows.h
--- src/mswindows.h     2002/05/18 02:16:23     1.6
+++ src/mswindows.h     2002/05/20 00:36:29
@@ -65,6 +65,10 @@
 #endif
 #endif
 
+/* Use ANSI-style stdargs regardless of whether the compiler bothers
+   to define __STDC__.  (Many don't when extensions are enabled.)  */
+#define WGET_USE_STDARG
+
 #define REALCLOSE(x) closesocket (x)
 
 /* read & write don't work with sockets on Windows 95.  */
Index: windows/config.h.bor
===================================================================
RCS file: /pack/anoncvs/wget/windows/config.h.bor,v
retrieving revision 1.8
diff -u -r1.8 config.h.bor
--- windows/config.h.bor        2002/05/18 02:16:36     1.8
+++ windows/config.h.bor        2002/05/20 00:36:29
@@ -29,12 +29,6 @@
 #ifndef CONFIG_H
 #define CONFIG_H
 
-/* Borland C does not define __STDC__ when the Borland extensions are
-   enabled, but you need those extensions to compile <windows.h>.  */
-#if !defined(__STDC__) && defined(__BORLANDC__)
-# define __STDC__ 1
-#endif
-
 #define HAVE_MEMMOVE
 #define ftruncate chsize
 #define inline __inline
Index: windows/config.h.ms
===================================================================
RCS file: /pack/anoncvs/wget/windows/config.h.ms,v
retrieving revision 1.8
diff -u -r1.8 config.h.ms
--- windows/config.h.ms 2002/05/18 02:16:36     1.8
+++ windows/config.h.ms 2002/05/20 00:36:29
@@ -29,19 +29,6 @@
 #ifndef CONFIG_H
 #define CONFIG_H
 
-/* MS Visual C does not define __STDC__ when the MSC extensions are
-   enabled, but you need those extensions to compile <windows.h>.  */
-#if !defined(__STDC__) && defined(_MSC_EXTENSIONS)
-# define __STDC__ 1
-#endif
-
-/* Setting __STDC__ causes MSVC to break other stuff... */
-#if __STDC__ && defined(_MSC_VER)
-# define utimbuf _utimbuf
-# define O_RDONLY _O_RDONLY
-# define alloca _alloca
-#endif
-
 /* Define if you have the <alloca.h> header file.  */
 #undef HAVE_ALLOCA_H
 

Reply via email to