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, ... ) ...@@ -210,6 +210,24 @@ static inline int __wine_dbg_cdecl wine_dbg_printf( const char *format, ... )
return ret; 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, static int __wine_dbg_cdecl wine_dbg_log( enum __wine_debug_class cls,
struct __wine_debug_channel *channel, const char *func, struct __wine_debug_channel *channel, const char *func,
const char *format, ... ) __WINE_PRINTF_ATTR(4,5); 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, ...@@ -217,21 +235,12 @@ static inline int __wine_dbg_cdecl wine_dbg_log( enum __wine_debug_class cls,
struct __wine_debug_channel *channel, struct __wine_debug_channel *channel,
const char *function, const char *format, ... ) const char *function, const char *format, ... )
{ {
char buffer[1024];
va_list args; va_list args;
int ret; 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 ); va_start( args, format );
vsnprintf( buffer, sizeof(buffer), format, args ); ret = wine_dbg_vlog( cls, channel, function, format, args );
va_end( args ); va_end( args );
ret += __wine_dbg_output( buffer );
return ret; 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