From: Daniel Stenberg Date: Thu, 9 Jan 2025 07:49:15 +0000 (+0100) Subject: curl_trc: repair build with verbose strings disabled X-Git-Tag: curl-8_12_0~172 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d1c1c96e0af076c13f4fb887df55287187861af8;p=thirdparty%2Fcurl.git curl_trc: repair build with verbose strings disabled - moved the dummy functions into the C file, made them non-static - added a Curl_trc_ssls dummy Closes #15951 --- diff --git a/lib/curl_trc.c b/lib/curl_trc.c index dcb7813f6d..e773e4fe7e 100644 --- a/lib/curl_trc.c +++ b/lib/curl_trc.c @@ -448,4 +448,53 @@ CURLcode Curl_trc_init(void) return CURLE_OK; } +void Curl_infof(struct Curl_easy *data, const char *fmt, ...) +{ + (void)data; (void)fmt; +} + +void Curl_trc_cf_infof(struct Curl_easy *data, + struct Curl_cfilter *cf, + const char *fmt, ...) +{ + (void)data; (void)cf; (void)fmt; +} + +struct curl_trc_feat; + +void Curl_trc_write(struct Curl_easy *data, const char *fmt, ...) +{ + (void)data; (void)fmt; +} + +void Curl_trc_read(struct Curl_easy *data, const char *fmt, ...) +{ + (void)data; (void)fmt; +} + +#ifndef CURL_DISABLE_FTP +void Curl_trc_ftp(struct Curl_easy *data, const char *fmt, ...) +{ + (void)data; (void)fmt; +} +#endif +#ifndef CURL_DISABLE_SMTP +void Curl_trc_smtp(struct Curl_easy *data, const char *fmt, ...) +{ + (void)data; (void)fmt; +} +#endif +#if !defined(CURL_DISABLE_WEBSOCKETS) || !defined(CURL_DISABLE_HTTP) +void Curl_trc_ws(struct Curl_easy *data, const char *fmt, ...) +{ + (void)data; (void)fmt; +} +#endif + +void Curl_trc_ssls(struct Curl_easy *data, const char *fmt, ...) +{ + (void)data; + (void)fmt; +} + #endif /* !defined(CURL_DISABLE_VERBOSE_STRINGS) */ diff --git a/lib/curl_trc.h b/lib/curl_trc.h index c796d671d0..9b4e36eef9 100644 --- a/lib/curl_trc.h +++ b/lib/curl_trc.h @@ -70,7 +70,45 @@ void Curl_failf(struct Curl_easy *data, #define CURL_HAVE_C99 #endif -#ifdef CURL_HAVE_C99 +/** + * Output an informational message when transfer's verbose logging is enabled. + */ +void Curl_infof(struct Curl_easy *data, + const char *fmt, ...) CURL_PRINTF(2, 3); + +/** + * 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, + const char *fmt, ...) CURL_PRINTF(3, 4); +void Curl_trc_write(struct Curl_easy *data, + const char *fmt, ...) CURL_PRINTF(2, 3); +void Curl_trc_read(struct Curl_easy *data, + const char *fmt, ...) CURL_PRINTF(2, 3); + +#ifndef CURL_DISABLE_FTP +extern struct curl_trc_feat Curl_trc_feat_ftp; +void Curl_trc_ftp(struct Curl_easy *data, + const char *fmt, ...) CURL_PRINTF(2, 3); +#endif +#ifndef CURL_DISABLE_SMTP +extern struct curl_trc_feat Curl_trc_feat_smtp; +void Curl_trc_smtp(struct Curl_easy *data, + const char *fmt, ...) CURL_PRINTF(2, 3); +#endif +#ifdef USE_SSL +extern struct curl_trc_feat Curl_trc_feat_ssls; +void Curl_trc_ssls(struct Curl_easy *data, + const char *fmt, ...) CURL_PRINTF(2, 3); +#endif +#if !defined(CURL_DISABLE_WEBSOCKETS) && !defined(CURL_DISABLE_HTTP) +extern struct curl_trc_feat Curl_trc_feat_ws; +void Curl_trc_ws(struct Curl_easy *data, + const char *fmt, ...) CURL_PRINTF(2, 3); +#endif + +#if defined(CURL_HAVE_C99) && !defined(CURL_DISABLE_VERBOSE_STRINGS) #define infof(data, ...) \ do { if(Curl_trc_is_verbose(data)) \ Curl_infof(data, __VA_ARGS__); } while(0) @@ -148,45 +186,6 @@ extern struct curl_trc_feat Curl_trc_feat_write; (Curl_trc_is_verbose(data) && \ (ft)->log_level >= CURL_LOG_LVL_INFO) -/** - * Output an informational message when transfer's verbose logging is enabled. - */ -void Curl_infof(struct Curl_easy *data, - const char *fmt, ...) CURL_PRINTF(2, 3); - -/** - * 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, - const char *fmt, ...) CURL_PRINTF(3, 4); -void Curl_trc_write(struct Curl_easy *data, - const char *fmt, ...) CURL_PRINTF(2, 3); -void Curl_trc_read(struct Curl_easy *data, - const char *fmt, ...) CURL_PRINTF(2, 3); - -#ifndef CURL_DISABLE_FTP -extern struct curl_trc_feat Curl_trc_feat_ftp; -void Curl_trc_ftp(struct Curl_easy *data, - const char *fmt, ...) CURL_PRINTF(2, 3); -#endif -#ifndef CURL_DISABLE_SMTP -extern struct curl_trc_feat Curl_trc_feat_smtp; -void Curl_trc_smtp(struct Curl_easy *data, - const char *fmt, ...) CURL_PRINTF(2, 3); -#endif -#ifdef USE_SSL -extern struct curl_trc_feat Curl_trc_feat_ssls; -void Curl_trc_ssls(struct Curl_easy *data, - const char *fmt, ...) CURL_PRINTF(2, 3); -#endif -#if !defined(CURL_DISABLE_WEBSOCKETS) && !defined(CURL_DISABLE_HTTP) -extern struct curl_trc_feat Curl_trc_feat_ws; -void Curl_trc_ws(struct Curl_easy *data, - const char *fmt, ...) CURL_PRINTF(2, 3); -#endif - - #else /* defined(CURL_DISABLE_VERBOSE_STRINGS) */ /* All informational messages are not compiled in for size savings */ @@ -194,49 +193,6 @@ void Curl_trc_ws(struct Curl_easy *data, #define Curl_trc_cf_is_verbose(x,y) (FALSE) #define Curl_trc_ft_is_verbose(x,y) (FALSE) -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; -} - -struct curl_trc_feat; - -static void Curl_trc_write(struct Curl_easy *data, const char *fmt, ...) -{ - (void)data; (void)fmt; -} - -static void Curl_trc_read(struct Curl_easy *data, const char *fmt, ...) -{ - (void)data; (void)fmt; -} - -#ifndef CURL_DISABLE_FTP -static void Curl_trc_ftp(struct Curl_easy *data, const char *fmt, ...) -{ - (void)data; (void)fmt; -} -#endif -#ifndef CURL_DISABLE_SMTP -static void Curl_trc_smtp(struct Curl_easy *data, const char *fmt, ...) -{ - (void)data; (void)fmt; -} -#endif -#if !defined(CURL_DISABLE_WEBSOCKETS) || !defined(CURL_DISABLE_HTTP) -static void Curl_trc_ws(struct Curl_easy *data, const char *fmt, ...) -{ - (void)data; (void)fmt; -} -#endif - #endif /* !defined(CURL_DISABLE_VERBOSE_STRINGS) */ #endif /* HEADER_CURL_TRC_H */