]> sjero.net Git - wget/commitdiff
[svn] Use stdarg only if compiling with an ANSI C compiler.
authorhniksic <devnull@localhost>
Thu, 11 Apr 2002 19:13:57 +0000 (12:13 -0700)
committerhniksic <devnull@localhost>
Thu, 11 Apr 2002 19:13:57 +0000 (12:13 -0700)
src/ChangeLog
src/log.c

index 590f3861e17804f0fc9fc77a57091d729fbf347b..9b0c2005ee30f894fd63e64cc5aec5129841b5c7 100644 (file)
@@ -1,3 +1,8 @@
+2002-04-11  Hrvoje Niksic  <hniksic@arsdigita.com>
+
+       * log.c: Set WGET_USE_STDARG if __STDC__ is defined and stdarg.h
+       is present.
+
 2002-04-11  Hrvoje Niksic  <hniksic@arsdigita.com>
 
        * progress.c (bar_create): If INITIAL is larger than TOTAL, fix
index 85a8b5edbbbe266c19b096fad58c1933cebef4a0..89e46d9af3e52ebbcafdb78b72b28f49fe2e6620 100644 (file)
--- a/src/log.c
+++ b/src/log.c
@@ -19,6 +19,16 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
 
 #include <config.h>
 
+/* 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
+# endif
+#endif
+
 #include <stdio.h>
 #ifdef HAVE_STRING_H
 # include <string.h>
@@ -26,8 +36,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
 # include <strings.h>
 #endif
 #include <stdlib.h>
-#ifdef HAVE_STDARG_H
-# define WGET_USE_STDARG
+#ifdef WGET_USE_STDARG
 # include <stdarg.h>
 #else
 # include <varargs.h>