Commit 65ad7fcd authored by Alexandre Julliard's avatar Alexandre Julliard

include: Add a va_list version of the wine_dbg_log function.

parent 3fdc28c7
......@@ -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;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment