Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
4d0468e3
Commit
4d0468e3
authored
Aug 30, 2022
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
include: Simplify handling of va_list in debug printf functions.
parent
a8b007da
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
15 deletions
+9
-15
debug.h
include/wine/debug.h
+9
-15
No files found.
include/wine/debug.h
View file @
4d0468e3
...
...
@@ -164,25 +164,19 @@ extern int __cdecl __wine_dbg_header( enum __wine_debug_class cls, struct __wine
#if (defined(__x86_64__) || (defined(__aarch64__) && __has_attribute(ms_abi))) && defined(__GNUC__) && defined(__WINE_USE_MSVCRT)
# define __wine_dbg_cdecl __cdecl
# define __wine_dbg_va_list __builtin_ms_va_list
# define __wine_dbg_va_start(list,arg) __builtin_ms_va_start(list,arg)
# define __wine_dbg_va_end(list) __builtin_ms_va_end(list)
#else
# define __wine_dbg_cdecl
# define __wine_dbg_va_list va_list
# define __wine_dbg_va_start(list,arg) va_start(list,arg)
# define __wine_dbg_va_end(list) va_end(list)
#endif
static
const
char
*
__wine_dbg_cdecl
wine_dbg_sprintf
(
const
char
*
format
,
...
)
__WINE_PRINTF_ATTR
(
1
,
2
);
static
inline
const
char
*
__wine_dbg_cdecl
wine_dbg_sprintf
(
const
char
*
format
,
...
)
{
char
buffer
[
200
];
__wine_dbg_
va_list
args
;
va_list
args
;
__wine_dbg_
va_start
(
args
,
format
);
va_start
(
args
,
format
);
vsnprintf
(
buffer
,
sizeof
(
buffer
),
format
,
args
);
__wine_dbg_
va_end
(
args
);
va_end
(
args
);
return
__wine_dbg_strdup
(
buffer
);
}
...
...
@@ -190,11 +184,11 @@ static int __wine_dbg_cdecl wine_dbg_printf( const char *format, ... ) __WINE_PR
static
inline
int
__wine_dbg_cdecl
wine_dbg_printf
(
const
char
*
format
,
...
)
{
char
buffer
[
1024
];
__wine_dbg_
va_list
args
;
va_list
args
;
__wine_dbg_
va_start
(
args
,
format
);
va_start
(
args
,
format
);
vsnprintf
(
buffer
,
sizeof
(
buffer
),
format
,
args
);
__wine_dbg_
va_end
(
args
);
va_end
(
args
);
return
__wine_dbg_output
(
buffer
);
}
...
...
@@ -206,7 +200,7 @@ static inline int __wine_dbg_cdecl wine_dbg_log( enum __wine_debug_class cls,
const
char
*
function
,
const
char
*
format
,
...
)
{
char
buffer
[
1024
];
__wine_dbg_
va_list
args
;
va_list
args
;
int
ret
;
if
(
*
format
==
'\1'
)
/* special magic to avoid standard prefix */
...
...
@@ -216,9 +210,9 @@ static inline int __wine_dbg_cdecl wine_dbg_log( enum __wine_debug_class cls,
}
if
((
ret
=
__wine_dbg_header
(
cls
,
channel
,
function
))
==
-
1
)
return
ret
;
__wine_dbg_
va_start
(
args
,
format
);
va_start
(
args
,
format
);
vsnprintf
(
buffer
,
sizeof
(
buffer
),
format
,
args
);
__wine_dbg_
va_end
(
args
);
va_end
(
args
);
ret
+=
__wine_dbg_output
(
buffer
);
return
ret
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment