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
864dc598
Commit
864dc598
authored
Nov 10, 2000
by
Dimitrie O. Paun
Committed by
Alexandre Julliard
Nov 10, 2000
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use variable argument macros when compiling with gcc.
parent
28fd5580
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
79 additions
and
72 deletions
+79
-72
debugtools.c
dlls/ntdll/debugtools.c
+16
-20
ntdll.spec
dlls/ntdll/ntdll.spec
+4
-4
file.c
files/file.c
+1
-1
debugtools.h
include/debugtools.h
+58
-47
No files found.
dlls/ntdll/debugtools.c
View file @
864dc598
...
...
@@ -64,7 +64,7 @@ static inline void release( void *ptr )
/* ---------------------------------------------------------------------- */
const
char
*
debu
gstr_an
(
const
char
*
src
,
int
n
)
const
char
*
wine_db
gstr_an
(
const
char
*
src
,
int
n
)
{
char
*
dst
,
*
res
;
...
...
@@ -114,7 +114,7 @@ const char *debugstr_an( const char *src, int n )
/* ---------------------------------------------------------------------- */
const
char
*
debu
gstr_wn
(
const
WCHAR
*
src
,
int
n
)
const
char
*
wine_db
gstr_wn
(
const
WCHAR
*
src
,
int
n
)
{
char
*
dst
,
*
res
;
...
...
@@ -164,7 +164,7 @@ const char *debugstr_wn( const WCHAR *src, int n )
/* ---------------------------------------------------------------------- */
const
char
*
debu
gstr_guid
(
const
GUID
*
id
)
const
char
*
wine_db
gstr_guid
(
const
GUID
*
id
)
{
char
*
str
;
...
...
@@ -212,27 +212,23 @@ int wine_dbg_printf(const char *format, ...)
va_list
valist
;
va_start
(
valist
,
format
);
ret
=
wine_dbg_vprintf
(
format
,
valist
);
ret
=
wine_dbg_vprintf
(
format
,
valist
);
va_end
(
valist
);
return
ret
;
}
int
__wine_dbg_header_err
(
const
char
*
dbg_channel
,
const
char
*
func
)
int
wine_dbg_log
(
enum
__DEBUG_CLASS
cls
,
const
char
*
channel
,
const
char
*
function
,
const
char
*
format
,
...
)
{
return
wine_dbg_printf
(
"err:%s:%s "
,
dbg_channel
+
1
,
func
);
}
int
__wine_dbg_header_fixme
(
const
char
*
dbg_channel
,
const
char
*
func
)
{
return
wine_dbg_printf
(
"fixme:%s:%s "
,
dbg_channel
+
1
,
func
);
}
int
__wine_dbg_header_warn
(
const
char
*
dbg_channel
,
const
char
*
func
)
{
return
wine_dbg_printf
(
"warn:%s:%s "
,
dbg_channel
+
1
,
func
);
}
static
const
char
*
classes
[
__DBCL_COUNT
]
=
{
"fixme"
,
"err"
,
"warn"
,
"trace"
};
va_list
valist
;
int
ret
=
0
;
int
__wine_dbg_header_trace
(
const
char
*
dbg_channel
,
const
char
*
func
)
{
return
wine_dbg_printf
(
"trace:%s:%s "
,
dbg_channel
+
1
,
func
);
va_start
(
valist
,
format
);
if
(
cls
<
__DBCL_COUNT
)
ret
=
wine_dbg_printf
(
"%s:%s:%s "
,
classes
[
cls
],
channel
+
1
,
function
);
if
(
format
)
ret
+=
wine_dbg_vprintf
(
format
,
valist
);
va_end
(
valist
);
return
ret
;
}
dlls/ntdll/ntdll.spec
View file @
864dc598
...
...
@@ -1017,12 +1017,12 @@ debug_channels (aspi atom cdrom console ddraw debug delayhlp dll dosfs dosmem
@ cdecl __wine_finally_handler(ptr ptr ptr ptr) __wine_finally_handler
# Debugging interface
@ cdecl __wine_dbg_header_err(ptr str) __wine_dbg_header_err
@ cdecl __wine_dbg_header_fixme(ptr str) __wine_dbg_header_fixme
@ cdecl __wine_dbg_header_warn(ptr str) __wine_dbg_header_warn
@ cdecl __wine_dbg_header_trace(ptr str) __wine_dbg_header_trace
@ cdecl wine_dbgstr_an(str long) wine_dbgstr_an
@ cdecl wine_dbgstr_wn(str long) wine_dbgstr_wn
@ cdecl wine_dbgstr_guid(ptr) wine_dbgstr_guid
@ cdecl wine_dbg_vprintf(str ptr) wine_dbg_vprintf
@ varargs wine_dbg_printf(str) wine_dbg_printf
@ varargs wine_dbg_log(long str str str) wine_dbg_log
# Command-line
@ cdecl __wine_get_main_args(ptr) __wine_get_main_args
files/file.c
View file @
864dc598
...
...
@@ -296,7 +296,7 @@ void FILE_SetDosError(void)
SetLastError
(
ERROR_BAD_FORMAT
);
break
;
default:
WARN
(
strerror
(
save_errno
)
);
WARN
(
"unknown file error: %s"
,
strerror
(
save_errno
)
);
SetLastError
(
ERROR_GEN_FAILURE
);
break
;
}
...
...
include/debugtools.h
View file @
864dc598
...
...
@@ -15,77 +15,88 @@ struct _GUID;
enum
__DEBUG_CLASS
{
__DBCL_FIXME
,
__DBCL_ERR
,
__DBCL_WARN
,
__DBCL_TRACE
,
__DBCL_COUNT
};
#ifndef NO_TRACE_MSGS
# define __GET_DEBUGGING_
trace
(dbch) ((dbch)[0] & (1 << __DBCL_TRACE))
# define __GET_DEBUGGING_
TRACE
(dbch) ((dbch)[0] & (1 << __DBCL_TRACE))
#else
# define __GET_DEBUGGING_
trace
(dbch) 0
# define __GET_DEBUGGING_
TRACE
(dbch) 0
#endif
#ifndef NO_DEBUG_MSGS
# define __GET_DEBUGGING_
warn
(dbch) ((dbch)[0] & (1 << __DBCL_WARN))
# define __GET_DEBUGGING_
fixme
(dbch) ((dbch)[0] & (1 << __DBCL_FIXME))
# define __GET_DEBUGGING_
WARN
(dbch) ((dbch)[0] & (1 << __DBCL_WARN))
# define __GET_DEBUGGING_
FIXME
(dbch) ((dbch)[0] & (1 << __DBCL_FIXME))
#else
# define __GET_DEBUGGING_
warn
(dbch) 0
# define __GET_DEBUGGING_
fixme
(dbch) 0
# define __GET_DEBUGGING_
WARN
(dbch) 0
# define __GET_DEBUGGING_
FIXME
(dbch) 0
#endif
/* define error macro regardless of what is configured */
#define __GET_DEBUGGING_
err
(dbch) ((dbch)[0] & (1 << __DBCL_ERR))
#define __GET_DEBUGGING_
ERR
(dbch) ((dbch)[0] & (1 << __DBCL_ERR))
#define __GET_DEBUGGING(dbcl,dbch) __GET_DEBUGGING
_
##dbcl(dbch)
#define __GET_DEBUGGING(dbcl,dbch) __GET_DEBUGGING##dbcl(dbch)
#define __SET_DEBUGGING(dbcl,dbch,on) \
((on) ? ((dbch)[0] |= 1 << (dbcl)) : ((dbch)[0] &= ~(1 << (dbcl))))
#ifndef __GNUC__
#define __FUNCTION__ ""
#endif
#ifdef __GNUC__
#define __DPRINTF(dbcl,dbch) \
(!__GET_DEBUGGING(dbcl,(dbch)) || (__wine_dbg_header_##dbcl((dbch),__FUNCTION__),0)) ? \
(void)0 : (void)wine_dbg_printf
do { if(__GET_DEBUGGING(dbcl,(dbch))) { \
const char * const __dbch = (dbch); \
const enum __DEBUG_CLASS __dbcl = __DBCL##dbcl; \
__WINE_DBG_LOG
extern
int
__wine_dbg_header_err
(
const
char
*
dbg_channel
,
const
char
*
func
);
extern
int
__wine_dbg_header_warn
(
const
char
*
dbg_channel
,
const
char
*
func
);
extern
int
__wine_dbg_header_fixme
(
const
char
*
dbg_channel
,
const
char
*
func
);
extern
int
__wine_dbg_header_trace
(
const
char
*
dbg_channel
,
const
char
*
func
);
#define __WINE_DBG_LOG(args...) \
wine_dbg_log( __dbcl, __dbch, __FUNCTION__, args); } } while(0)
/* Exported definitions and macros */
#define __PRINTF_ATTR(fmt,args) __attribute__((format (printf,fmt,args)));
/* These function return a printable version of a string, including
quotes. The string will be valid for some time, but not indefinitely
as strings are re-used. */
extern
const
char
*
debugstr_an
(
const
char
*
s
,
int
n
);
extern
const
char
*
debugstr_wn
(
const
WCHAR
*
s
,
int
n
);
extern
const
char
*
debugstr_guid
(
const
struct
_GUID
*
id
);
#else
/* __GNUC__ */
extern
int
wine_dbg_vprintf
(
const
char
*
format
,
va_list
args
);
inline
static
const
char
*
debugstr_a
(
const
char
*
s
)
{
return
debugstr_an
(
s
,
80
);
}
inline
static
const
char
*
debugstr_w
(
const
WCHAR
*
s
)
{
return
debugstr_wn
(
s
,
80
);
}
inline
static
const
char
*
debugres_a
(
const
char
*
s
)
{
return
debugstr_an
(
s
,
80
);
}
inline
static
const
char
*
debugres_w
(
const
WCHAR
*
s
)
{
return
debugstr_wn
(
s
,
80
);
}
#define __DPRINTF(dbcl,dbch) \
(!__GET_DEBUGGING(dbcl,(dbch)) || \
(wine_dbg_log(__DBCL##dbcl,(dbch),__FILE__,"%d: ",__LINE__),0)) ? \
(void)0 : (void)wine_dbg_printf
#ifdef __GNUC__
extern
int
wine_dbg_printf
(
const
char
*
format
,
...)
__attribute__
((
format
(
printf
,
1
,
2
)));
#else
extern
int
wine_dbg_printf
(
const
char
*
format
,
...);
#endif
#define __PRINTF_ATTR(fmt, args)
#define TRACE __DPRINTF(trace,__wine_dbch___default)
#define TRACE_(ch) __DPRINTF(trace,__wine_dbch_##ch)
#define TRACE_ON(ch) __GET_DEBUGGING(trace,__wine_dbch_##ch)
#endif
/* __GNUC__ */
#define WARN __DPRINTF(warn,__wine_dbch___default)
#define WARN_(ch) __DPRINTF(warn,__wine_dbch_##ch)
#define WARN_ON(ch) __GET_DEBUGGING(warn,__wine_dbch_##ch)
/* Exported definitions and macros */
#define FIXME __DPRINTF(fixme,__wine_dbch___default)
#define FIXME_(ch) __DPRINTF(fixme,__wine_dbch_##ch)
#define FIXME_ON(ch) __GET_DEBUGGING(fixme,__wine_dbch_##ch)
/* These function return a printable version of a string, including
quotes. The string will be valid for some time, but not indefinitely
as strings are re-used. */
extern
const
char
*
wine_dbgstr_an
(
const
char
*
s
,
int
n
);
extern
const
char
*
wine_dbgstr_wn
(
const
WCHAR
*
s
,
int
n
);
extern
const
char
*
wine_dbgstr_guid
(
const
struct
_GUID
*
id
);
extern
int
wine_dbg_vprintf
(
const
char
*
format
,
va_list
args
)
__PRINTF_ATTR
(
1
,
0
);
extern
int
wine_dbg_printf
(
const
char
*
format
,
...
)
__PRINTF_ATTR
(
1
,
2
);
extern
int
wine_dbg_log
(
enum
__DEBUG_CLASS
cls
,
const
char
*
ch
,
const
char
*
func
,
const
char
*
format
,
...
)
__PRINTF_ATTR
(
4
,
5
);
inline
static
const
char
*
debugstr_an
(
const
char
*
s
,
int
n
)
{
return
wine_dbgstr_an
(
s
,
n
);
}
inline
static
const
char
*
debugstr_wn
(
const
WCHAR
*
s
,
int
n
)
{
return
wine_dbgstr_wn
(
s
,
n
);
}
inline
static
const
char
*
debugstr_guid
(
const
struct
_GUID
*
id
)
{
return
wine_dbgstr_guid
(
id
);
}
inline
static
const
char
*
debugstr_a
(
const
char
*
s
)
{
return
wine_dbgstr_an
(
s
,
80
);
}
inline
static
const
char
*
debugstr_w
(
const
WCHAR
*
s
)
{
return
wine_dbgstr_wn
(
s
,
80
);
}
inline
static
const
char
*
debugres_a
(
const
char
*
s
)
{
return
wine_dbgstr_an
(
s
,
80
);
}
inline
static
const
char
*
debugres_w
(
const
WCHAR
*
s
)
{
return
wine_dbgstr_wn
(
s
,
80
);
}
#define TRACE __DPRINTF(_TRACE,__wine_dbch___default)
#define TRACE_(ch) __DPRINTF(_TRACE,__wine_dbch_##ch)
#define TRACE_ON(ch) __GET_DEBUGGING(_TRACE,__wine_dbch_##ch)
#define WARN __DPRINTF(_WARN,__wine_dbch___default)
#define WARN_(ch) __DPRINTF(_WARN,__wine_dbch_##ch)
#define WARN_ON(ch) __GET_DEBUGGING(_WARN,__wine_dbch_##ch)
#define FIXME __DPRINTF(_FIXME,__wine_dbch___default)
#define FIXME_(ch) __DPRINTF(_FIXME,__wine_dbch_##ch)
#define FIXME_ON(ch) __GET_DEBUGGING(_FIXME,__wine_dbch_##ch)
#undef ERR
/* Solaris got an 'ERR' define in <sys/reg.h> */
#define ERR __DPRINTF(
err
,__wine_dbch___default)
#define ERR_(ch) __DPRINTF(
err
,__wine_dbch_##ch)
#define ERR_ON(ch) __GET_DEBUGGING(
err
,__wine_dbch_##ch)
#define ERR __DPRINTF(
_ERR
,__wine_dbch___default)
#define ERR_(ch) __DPRINTF(
_ERR
,__wine_dbch_##ch)
#define ERR_ON(ch) __GET_DEBUGGING(
_ERR
,__wine_dbch_##ch)
#define DECLARE_DEBUG_CHANNEL(ch) \
extern char __wine_dbch_##ch[];
...
...
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