[PATCH 2/3] debug.h: cleanup ERR, WARN macros

Konstantin Kharlamov Hi-Angel at yandex.ru
Sat Jan 26 16:47:59 CST 2019


Same as prev. commit.

The complex "#ifdef WINE_NO_DEBUG_MSGS && __compiler__" ladder below
reduces to "ignore WINE_NO_DEBUG_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.

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

diff --git a/include/wine/debug.h b/include/wine/debug.h
index 069e754dfe..e9ec81c623 100644
--- a/include/wine/debug.h
+++ b/include/wine/debug.h
@@ -69,10 +69,20 @@ struct __wine_debug_channel
 
 #ifndef WINE_NO_DEBUG_MSGS
 # define __WINE_GET_DEBUGGING_WARN(dbch)  ((dbch)->flags & (1 << __WINE_DBCL_WARN))
+# define WINE_WARN                  __WINE_DPRINTF(_WARN,__wine_dbch___default)
+# define WINE_WARN_(ch)             __WINE_DPRINTF(_WARN,&__wine_dbch_##ch)
+
+# define WINE_FIXME                 __WINE_DPRINTF(_FIXME,__wine_dbch___default)
+# define WINE_FIXME_(ch)            __WINE_DPRINTF(_FIXME,&__wine_dbch_##ch)
 # define __WINE_GET_DEBUGGING_FIXME(dbch) ((dbch)->flags & (1 << __WINE_DBCL_FIXME))
 #else
 # define __WINE_GET_DEBUGGING_WARN(dbch)  0
+# define WINE_WARN(...) do { } while(0)
+# define WINE_WARN_(ch) WINE_WARN
+
 # define __WINE_GET_DEBUGGING_FIXME(dbch) 0
+# define WINE_FIXME(...) do { } while(0)
+# define WINE_FIXME_(ch) WINE_FIXME
 #endif
 
 /* define error macro regardless of what is configured */
@@ -96,13 +106,6 @@ struct __wine_debug_channel
 
 #define __WINE_PRINTF_ATTR(fmt,args) __attribute__((format (printf,fmt,args)))
 
-#ifdef WINE_NO_DEBUG_MSGS
-#define WINE_WARN(args...) do { } while(0)
-#define WINE_WARN_(ch) WINE_WARN
-#define WINE_FIXME(args...) do { } while(0)
-#define WINE_FIXME_(ch) WINE_FIXME
-#endif
-
 #elif defined(__SUNPRO_C)
 
 #define __WINE_DPRINTF(dbcl,dbch) \
@@ -116,13 +119,6 @@ struct __wine_debug_channel
 
 #define __WINE_PRINTF_ATTR(fmt,args)
 
-#ifdef WINE_NO_DEBUG_MSGS
-#define WINE_WARN(...) do { } while(0)
-#define WINE_WARN_(ch) WINE_WARN
-#define WINE_FIXME(...) do { } while(0)
-#define WINE_FIXME_(ch) WINE_FIXME
-#endif
-
 #else  /* !__GNUC__ && !__SUNPRO_C */
 
 #define __WINE_DPRINTF(dbcl,dbch) \
@@ -330,22 +326,12 @@ static inline const char *wine_dbgstr_variant( const VARIANT *v )
 
 #endif /* defined(__oaidl_h__) && defined(V_VT) */
 
-#define WINE_TRACE_ON(ch)          __WINE_IS_DEBUG_ON(_TRACE,&__wine_dbch_##ch)
-
-#ifndef WINE_WARN
-#define WINE_WARN                  __WINE_DPRINTF(_WARN,__wine_dbch___default)
-#define WINE_WARN_(ch)             __WINE_DPRINTF(_WARN,&__wine_dbch_##ch)
-#endif
-#define WINE_WARN_ON(ch)           __WINE_IS_DEBUG_ON(_WARN,&__wine_dbch_##ch)
-
-#ifndef WINE_FIXME
-#define WINE_FIXME                 __WINE_DPRINTF(_FIXME,__wine_dbch___default)
-#define WINE_FIXME_(ch)            __WINE_DPRINTF(_FIXME,&__wine_dbch_##ch)
-#endif
-#define WINE_FIXME_ON(ch)          __WINE_IS_DEBUG_ON(_FIXME,&__wine_dbch_##ch)
-
 #define WINE_ERR                   __WINE_DPRINTF(_ERR,__wine_dbch___default)
 #define WINE_ERR_(ch)              __WINE_DPRINTF(_ERR,&__wine_dbch_##ch)
+
+#define WINE_TRACE_ON(ch)          __WINE_IS_DEBUG_ON(_TRACE,&__wine_dbch_##ch)
+#define WINE_WARN_ON(ch)           __WINE_IS_DEBUG_ON(_WARN,&__wine_dbch_##ch)
+#define WINE_FIXME_ON(ch)          __WINE_IS_DEBUG_ON(_FIXME,&__wine_dbch_##ch)
 #define WINE_ERR_ON(ch)            __WINE_IS_DEBUG_ON(_ERR,&__wine_dbch_##ch)
 
 #define WINE_DECLARE_DEBUG_CHANNEL(ch) \
-- 
2.20.1




More information about the wine-devel mailing list