RFC: Should we use the macros in windowsx.h to fix -DSTRICT w arni ngs?

Alexandre Julliard julliard at winehq.com
Fri Aug 10 18:48:27 CDT 2001

Patrik Stridvall <ps at leissner.se> writes:

> Microsoft introduced the windowsx.h macros for a reason and
> while without inline functions the current implementation
> of the FORWARD_* macros was the best they could do, it
> was at least better than nothing since it at least handled
> the parameter marshalling even if it wasn't 100% type safe.

I wouldn't rely on Microsoft choices to judge an API design ;-)

> Another things to think about:
> What is the difference between calling  {Set,Get}WindowText
> functions and calling the FORWARD_WM_{GET,SET}TEXT macros?

It's a matter of taste. Calling a normal function is perfectly all
right; but I find that using a macro (or worse an inline function
masquerading as a macro) and having to pass it the name of the
function you want to call is ugly and offensive. If you want to call
SendMessage, then call SendMessage, don't hide it inside a macro.
Just because you can do all kinds of abuses of the preprocessor in C
doesn't mean you should.

Alexandre Julliard
julliard at winehq.com

More information about the wine-devel mailing list