|
@@ -54,19 +54,6 @@ CURLcode Curl_trc_opt(const char *config);
|
|
|
void Curl_debug(struct Curl_easy *data, curl_infotype type,
|
|
|
char *ptr, size_t size);
|
|
|
|
|
|
-/**
|
|
|
- * Output an informational message when transfer's verbose logging is enabled.
|
|
|
- */
|
|
|
-void Curl_infof(struct Curl_easy *data,
|
|
|
-#if defined(__GNUC__) && !defined(printf) && \
|
|
|
- defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) && \
|
|
|
- !defined(__MINGW32__)
|
|
|
- const char *fmt, ...)
|
|
|
- __attribute__((format(printf, 2, 3)));
|
|
|
-#else
|
|
|
- const char *fmt, ...);
|
|
|
-#endif
|
|
|
-
|
|
|
/**
|
|
|
* Output a failure message on registered callbacks for transfer.
|
|
|
*/
|
|
@@ -82,39 +69,15 @@ void Curl_failf(struct Curl_easy *data,
|
|
|
|
|
|
#define failf Curl_failf
|
|
|
|
|
|
-/**
|
|
|
- * Output an informational message when both transfer's verbose logging
|
|
|
- * and connection filters verbose logging are enabled.
|
|
|
- */
|
|
|
-void Curl_trc_cf_infof(struct Curl_easy *data, struct Curl_cfilter *cf,
|
|
|
-#if defined(__GNUC__) && !defined(printf) && \
|
|
|
- defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) && \
|
|
|
- !defined(__MINGW32__)
|
|
|
- const char *fmt, ...)
|
|
|
- __attribute__((format(printf, 3, 4)));
|
|
|
-#else
|
|
|
- const char *fmt, ...);
|
|
|
-#endif
|
|
|
-
|
|
|
#define CURL_LOG_LVL_NONE 0
|
|
|
#define CURL_LOG_LVL_INFO 1
|
|
|
|
|
|
|
|
|
-#if !defined(CURL_DISABLE_VERBOSE_STRINGS)
|
|
|
-/* informational messages enabled */
|
|
|
-
|
|
|
-#define Curl_trc_is_verbose(data) ((data) && (data)->set.verbose)
|
|
|
-#define Curl_trc_cf_is_verbose(cf, data) \
|
|
|
- ((data) && (data)->set.verbose && \
|
|
|
- (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
|
|
|
-
|
|
|
-/* explainer: we have some mix configuration and werror settings
|
|
|
- * that define HAVE_VARIADIC_MACROS_C99 even though C89 is enforced
|
|
|
- * on gnuc and some other compiler. Need to treat carefully.
|
|
|
- */
|
|
|
-#if defined(HAVE_VARIADIC_MACROS_C99) && \
|
|
|
- defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)
|
|
|
+#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
|
|
|
+#define CURL_HAVE_C99
|
|
|
+#endif
|
|
|
|
|
|
+#ifdef CURL_HAVE_C99
|
|
|
#define infof(data, ...) \
|
|
|
do { if(Curl_trc_is_verbose(data)) \
|
|
|
Curl_infof(data, __VA_ARGS__); } while(0)
|
|
@@ -122,10 +85,43 @@ void Curl_trc_cf_infof(struct Curl_easy *data, struct Curl_cfilter *cf,
|
|
|
do { if(Curl_trc_cf_is_verbose(cf, data)) \
|
|
|
Curl_trc_cf_infof(data, cf, __VA_ARGS__); } while(0)
|
|
|
|
|
|
-#else /* no variadic macro args */
|
|
|
+#else
|
|
|
#define infof Curl_infof
|
|
|
#define CURL_TRC_CF Curl_trc_cf_infof
|
|
|
-#endif /* variadic macro args */
|
|
|
+#endif
|
|
|
+
|
|
|
+#ifndef CURL_DISABLE_VERBOSE_STRINGS
|
|
|
+/* informational messages enabled */
|
|
|
+
|
|
|
+#define Curl_trc_is_verbose(data) ((data) && (data)->set.verbose)
|
|
|
+#define Curl_trc_cf_is_verbose(cf, data) \
|
|
|
+ ((data) && (data)->set.verbose && \
|
|
|
+ (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
|
|
|
+
|
|
|
+/**
|
|
|
+ * Output an informational message when transfer's verbose logging is enabled.
|
|
|
+ */
|
|
|
+void Curl_infof(struct Curl_easy *data,
|
|
|
+#if defined(__GNUC__) && !defined(printf) && defined(CURL_HAVE_C99) && \
|
|
|
+ !defined(__MINGW32__)
|
|
|
+ const char *fmt, ...)
|
|
|
+ __attribute__((format(printf, 2, 3)));
|
|
|
+#else
|
|
|
+ const char *fmt, ...);
|
|
|
+#endif
|
|
|
+
|
|
|
+/**
|
|
|
+ * Output an informational message when both transfer's verbose logging
|
|
|
+ * and connection filters verbose logging are enabled.
|
|
|
+ */
|
|
|
+void Curl_trc_cf_infof(struct Curl_easy *data, struct Curl_cfilter *cf,
|
|
|
+#if defined(__GNUC__) && !defined(printf) && defined(CURL_HAVE_C99) && \
|
|
|
+ !defined(__MINGW32__)
|
|
|
+ const char *fmt, ...)
|
|
|
+ __attribute__((format(printf, 3, 4)));
|
|
|
+#else
|
|
|
+ const char *fmt, ...);
|
|
|
+#endif
|
|
|
|
|
|
#else /* !CURL_DISABLE_VERBOSE_STRINGS */
|
|
|
/* All informational messages are not compiled in for size savings */
|
|
@@ -133,17 +129,17 @@ void Curl_trc_cf_infof(struct Curl_easy *data, struct Curl_cfilter *cf,
|
|
|
#define Curl_trc_is_verbose(d) ((void)(d), FALSE)
|
|
|
#define Curl_trc_cf_is_verbose(x,y) ((void)(x), (void)(y), FALSE)
|
|
|
|
|
|
-#if defined(HAVE_VARIADIC_MACROS_C99)
|
|
|
-#define infof(...) Curl_nop_stmt
|
|
|
-#define CURL_TRC_CF(...) Curl_nop_stmt
|
|
|
-#define Curl_trc_cf_infof(...) Curl_nop_stmt
|
|
|
-#elif defined(HAVE_VARIADIC_MACROS_GCC)
|
|
|
-#define infof(x...) Curl_nop_stmt
|
|
|
-#define CURL_TRC_CF(x...) Curl_nop_stmt
|
|
|
-#define Curl_trc_cf_infof(x...) Curl_nop_stmt
|
|
|
-#else
|
|
|
-#error "missing VARIADIC macro define, fix and rebuild!"
|
|
|
-#endif
|
|
|
+static void Curl_infof(struct Curl_easy *data, const char *fmt, ...)
|
|
|
+{
|
|
|
+ (void)data; (void)fmt;
|
|
|
+}
|
|
|
+
|
|
|
+static void Curl_trc_cf_infof(struct Curl_easy *data,
|
|
|
+ struct Curl_cfilter *cf,
|
|
|
+ const char *fmt, ...)
|
|
|
+{
|
|
|
+ (void)data; (void)cf; (void)fmt;
|
|
|
+}
|
|
|
|
|
|
#endif /* CURL_DISABLE_VERBOSE_STRINGS */
|
|
|
|