[PATCH v2 1/3] debug.h: cleanup TRACE macros

Konstantin Kharlamov Hi-Angel at yandex.ru
Sun Jan 27 03:32:40 CST 2019


The complex "#ifdef WINE_NO_TRACE_MSGS && __compiler__" ladder below
reduces to "ignore WINE_NO_TRACE_MSGS when !__GNUC__ && !__SUNPRO_C",
which is probably a bug.

The other nuance is the removed "args" prefix, which is a GNU extension,
and was not used anyway.

Let's just define all of that in a single place.

v2: missed one "args..." in definition (Chip Davis)

Signed-off-by: Konstantin Kharlamov <Hi-Angel at yandex.ru>
---
 include/wine/debug.h | 19 ++++---------------
 1 file changed, 4 insertions(+), 15 deletions(-)

diff --git a/include/wine/debug.h b/include/wine/debug.h
index 07ac88d264..86c7d2fac7 100644
--- a/include/wine/debug.h
+++ b/include/wine/debug.h
@@ -59,8 +59,12 @@ struct __wine_debug_channel
 
 #ifndef WINE_NO_TRACE_MSGS
 # define __WINE_GET_DEBUGGING_TRACE(dbch) ((dbch)->flags & (1 << __WINE_DBCL_TRACE))
+# define WINE_TRACE                 __WINE_DPRINTF(_TRACE,__wine_dbch___default)
+# define WINE_TRACE_(ch)            __WINE_DPRINTF(_TRACE,&__wine_dbch_##ch)
 #else
 # define __WINE_GET_DEBUGGING_TRACE(dbch) 0
+# define WINE_TRACE(...) do { } while(0)
+# define WINE_TRACE_(ch) WINE_TRACE
 #endif
 
 #ifndef WINE_NO_DEBUG_MSGS
@@ -92,12 +96,6 @@ struct __wine_debug_channel
 
 #define __WINE_PRINTF_ATTR(fmt,args) __attribute__((format (printf,fmt,args)))
 
-
-#ifdef WINE_NO_TRACE_MSGS
-#define WINE_TRACE(args...) do { } while(0)
-#define WINE_TRACE_(ch) WINE_TRACE
-#endif
-
 #ifdef WINE_NO_DEBUG_MSGS
 #define WINE_WARN(args...) do { } while(0)
 #define WINE_WARN_(ch) WINE_WARN
@@ -118,11 +116,6 @@ struct __wine_debug_channel
 
 #define __WINE_PRINTF_ATTR(fmt,args)
 
-#ifdef WINE_NO_TRACE_MSGS
-#define WINE_TRACE(...) do { } while(0)
-#define WINE_TRACE_(ch) WINE_TRACE
-#endif
-
 #ifdef WINE_NO_DEBUG_MSGS
 #define WINE_WARN(...) do { } while(0)
 #define WINE_WARN_(ch) WINE_WARN
@@ -337,10 +330,6 @@ static inline const char *wine_dbgstr_variant( const VARIANT *v )
 
 #endif /* defined(__oaidl_h__) && defined(V_VT) */
 
-#ifndef WINE_TRACE
-#define WINE_TRACE                 __WINE_DPRINTF(_TRACE,__wine_dbch___default)
-#define WINE_TRACE_(ch)            __WINE_DPRINTF(_TRACE,&__wine_dbch_##ch)
-#endif
 #define WINE_TRACE_ON(ch)          __WINE_IS_DEBUG_ON(_TRACE,&__wine_dbch_##ch)
 
 #ifndef WINE_WARN
-- 
2.20.1




More information about the wine-devel mailing list