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
f2e6f05f
Commit
f2e6f05f
authored
Apr 03, 2019
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
include: Make wine_dbg_sprintf() into an inline function.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
9f75f718
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
1 deletion
+27
-1
debug.h
include/wine/debug.h
+25
-1
debug.c
libs/wine/debug.c
+2
-0
No files found.
include/wine/debug.h
View file @
f2e6f05f
...
@@ -22,6 +22,7 @@
...
@@ -22,6 +22,7 @@
#define __WINE_WINE_DEBUG_H
#define __WINE_WINE_DEBUG_H
#include <stdarg.h>
#include <stdarg.h>
#include <stdio.h>
#include <windef.h>
#include <windef.h>
#ifndef _NTSYSTEM_
#ifndef _NTSYSTEM_
#include <winbase.h>
#include <winbase.h>
...
@@ -169,12 +170,35 @@ extern const char * __cdecl __wine_dbg_strdup( const char *str );
...
@@ -169,12 +170,35 @@ extern const char * __cdecl __wine_dbg_strdup( const char *str );
/* These functions return a printable version of a string, including
/* These functions return a printable version of a string, including
quotes. The string will be valid for some time, but not indefinitely
quotes. The string will be valid for some time, but not indefinitely
as strings are re-used. */
as strings are re-used. */
extern
const
char
*
wine_dbg_sprintf
(
const
char
*
format
,
...
)
__WINE_PRINTF_ATTR
(
1
,
2
);
extern
int
wine_dbg_printf
(
const
char
*
format
,
...
)
__WINE_PRINTF_ATTR
(
1
,
2
);
extern
int
wine_dbg_printf
(
const
char
*
format
,
...
)
__WINE_PRINTF_ATTR
(
1
,
2
);
extern
int
wine_dbg_log
(
enum
__wine_debug_class
cls
,
struct
__wine_debug_channel
*
ch
,
const
char
*
func
,
extern
int
wine_dbg_log
(
enum
__wine_debug_class
cls
,
struct
__wine_debug_channel
*
ch
,
const
char
*
func
,
const
char
*
format
,
...
)
__WINE_PRINTF_ATTR
(
4
,
5
);
const
char
*
format
,
...
)
__WINE_PRINTF_ATTR
(
4
,
5
);
#if (defined(__x86_64__) || defined(__aarch64__)) && 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
;
__wine_dbg_va_start
(
args
,
format
);
vsnprintf
(
buffer
,
sizeof
(
buffer
),
format
,
args
);
__wine_dbg_va_end
(
args
);
return
__wine_dbg_strdup
(
buffer
);
}
static
inline
const
char
*
wine_dbgstr_an
(
const
char
*
str
,
int
n
)
static
inline
const
char
*
wine_dbgstr_an
(
const
char
*
str
,
int
n
)
{
{
static
const
char
hex
[
16
]
=
"0123456789abcdef"
;
static
const
char
hex
[
16
]
=
"0123456789abcdef"
;
...
...
libs/wine/debug.c
View file @
f2e6f05f
...
@@ -30,6 +30,7 @@
...
@@ -30,6 +30,7 @@
# include <sys/stat.h>
# include <sys/stat.h>
#endif
#endif
#define wine_dbg_sprintf wine_dbg_sprintf_inline
#define wine_dbgstr_an wine_dbgstr_an_inline
#define wine_dbgstr_an wine_dbgstr_an_inline
#define wine_dbgstr_wn wine_dbgstr_wn_inline
#define wine_dbgstr_wn wine_dbgstr_wn_inline
#include "wine/debug.h"
#include "wine/debug.h"
...
@@ -228,6 +229,7 @@ int wine_dbg_printf( const char *format, ... )
...
@@ -228,6 +229,7 @@ int wine_dbg_printf( const char *format, ... )
}
}
/* printf with temp buffer allocation */
/* printf with temp buffer allocation */
#undef wine_dbg_sprintf
const
char
*
wine_dbg_sprintf
(
const
char
*
format
,
...
)
const
char
*
wine_dbg_sprintf
(
const
char
*
format
,
...
)
{
{
static
const
int
max_size
=
200
;
static
const
int
max_size
=
200
;
...
...
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