Module: wine Branch: master Commit: 65ad7fcdab207a279136124d305ea78817ff8e3a URL: https://gitlab.winehq.org/wine/wine/-/commit/65ad7fcdab207a279136124d305ea78...
Author: Alexandre Julliard julliard@winehq.org Date: Thu Sep 1 10:15:39 2022 +0200
include: Add a va_list version of the wine_dbg_log function.
---
include/wine/debug.h | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-)
diff --git a/include/wine/debug.h b/include/wine/debug.h index 115f5c396b9..55497e9d73f 100644 --- a/include/wine/debug.h +++ b/include/wine/debug.h @@ -210,6 +210,24 @@ static inline int __wine_dbg_cdecl wine_dbg_printf( const char *format, ... ) return ret; }
+static int __wine_dbg_cdecl wine_dbg_vlog( enum __wine_debug_class cls, + struct __wine_debug_channel *channel, const char *func, + const char *format, va_list args ) __WINE_PRINTF_ATTR(4,0); +static inline int __wine_dbg_cdecl wine_dbg_vlog( enum __wine_debug_class cls, + struct __wine_debug_channel *channel, + const char *function, const char *format, va_list args ) +{ + int ret; + + if (*format == '\1') /* special magic to avoid standard prefix */ + { + format++; + function = NULL; + } + if ((ret = __wine_dbg_header( cls, channel, function )) != -1) ret += wine_dbg_vprintf( format, args ); + return ret; +} + static int __wine_dbg_cdecl wine_dbg_log( enum __wine_debug_class cls, struct __wine_debug_channel *channel, const char *func, const char *format, ... ) __WINE_PRINTF_ATTR(4,5); @@ -217,21 +235,12 @@ static inline int __wine_dbg_cdecl wine_dbg_log( enum __wine_debug_class cls, struct __wine_debug_channel *channel, const char *function, const char *format, ... ) { - char buffer[1024]; va_list args; int ret;
- if (*format == '\1') /* special magic to avoid standard prefix */ - { - format++; - function = NULL; - } - if ((ret = __wine_dbg_header( cls, channel, function )) == -1) return ret; - va_start( args, format ); - vsnprintf( buffer, sizeof(buffer), format, args ); + ret = wine_dbg_vlog( cls, channel, function, format, args ); va_end( args ); - ret += __wine_dbg_output( buffer ); return ret; }