]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
avoid the use of variadic macros for greater portability
authorYang Tse <yangsita@gmail.com>
Wed, 21 Mar 2007 08:17:13 +0000 (08:17 +0000)
committerYang Tse <yangsita@gmail.com>
Wed, 21 Mar 2007 08:17:13 +0000 (08:17 +0000)
lib/sendf.c
lib/sendf.h

index bf9ee490a77cef0eed1228a47f3bc5e6c6f3fd34..a4a1347f79e91d4f3f2da9fff352e0053f793982 100644 (file)
@@ -224,6 +224,10 @@ static size_t convert_lineends(struct SessionHandle *data,
 
 void Curl_infof(struct SessionHandle *data, const char *fmt, ...)
 {
+#ifdef CURL_DISABLE_VERBOSE_STRINGS
+  (void)data;
+  (void)fmt;
+#else
   if(data && data->set.verbose) {
     va_list ap;
     size_t len;
@@ -234,6 +238,7 @@ void Curl_infof(struct SessionHandle *data, const char *fmt, ...)
     len = strlen(print_buffer);
     Curl_debug(data, CURLINFO_TEXT, print_buffer, len, NULL);
   }
+#endif
 }
 
 /* Curl_failf() is for messages stating why we failed.
index 7877df8233919c4150694f6187ffd2396bbe19cd..65926192d5313a564b86f0d413780dfd6e94c054 100644 (file)
@@ -7,7 +7,7 @@
  *                            | (__| |_| |  _ <| |___
  *                             \___|\___/|_| \_\_____|
  *
- * Copyright (C) 1998 - 2006, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2007, Daniel Stenberg, <daniel@haxx.se>, et al.
  *
  * This software is licensed as described in the file COPYING, which
  * you should have received as part of this distribution. The terms
@@ -28,19 +28,7 @@ CURLcode Curl_sendf(curl_socket_t sockfd, struct connectdata *,
 void Curl_infof(struct SessionHandle *, const char *fmt, ...);
 void Curl_failf(struct SessionHandle *, const char *fmt, ...);
 
-#if defined(CURL_DISABLE_VERBOSE_STRINGS)
-#if defined(__GNUC__)
-/* This style of variable argument macros is a gcc extension */
-#define infof(x...) /*ignore*/
-#else
-/* C99 compilers could use this if we could detect them */
-/*#define infof(...) */
-/* Cast the args to void to make them a noop, side effects notwithstanding */
-#define infof (void)
-#endif
-#else
 #define infof Curl_infof
-#endif
 #define failf Curl_failf
 
 #define CLIENTWRITE_BODY   1