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

Konstantin Kharlamov hi-angel at yandex.ru
Mon Jan 28 05:40:20 CST 2019


On 28.01.2019 12:24, Alexandre Julliard wrote:
> Konstantin Kharlamov <Hi-Angel at yandex.ru> writes:
> 
>> 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.
> 
> No, it's on purpose, because some other compiler may not support varargs
> macros.

But then the workaround would result in incorrectly configured build. Is the complexity of the original code really worth the not even correct support of an obscure usecase?

That said, looking at definition, I could probably change it to a

	# define WINE_TRACE(arg1,arg2) do { } while(0)

because the other WINE_TRACE definition accepts 2 args. I'll check if it compiles when I get back home.

---------

While on it, could you please advice on the naming in the 3-rd patch? Initially I've used "unlikely" because that's how it's used in Mesa. Later then I saw in wine lots of lower-case macros with __ prefix, so I changed it to "__unlikely". But then there are generic macros like "TRACE", and I think of renaming it to "UNLIKELY", which is 2 letters shorter, and is upper-case like yet another part of macros.

My personal preference would go to lower-case function-like "unlikely" though.



More information about the wine-devel mailing list