side-effects/type safe min/max (Was Re: [1/3] d3dx9: Partial implementation of D3DXAssembleShader function. [try 2])

Henri Verbeet hverbeet at
Fri Feb 5 12:38:42 CST 2010

On 5 February 2010 19:10, Michael Stefaniuc <mstefani at> wrote:
> Henri Verbeet wrote:
>> min and max are already defined in windef.h. Note that they're not
>> safe for expressions with side-effects, but for simple expressions
>> like the one here they're ok.
> We can lift the side-effects and type safe min/max macros from the Linux
> Kernel. Of course Alexandre would have to accept the use of typeof(); we
> can do a fallback for the compilers that don't support that.
I imagine it can't be *that* hard to fix the macros, but wouldn't that
make them incompatible with the PSDK ones?

More information about the wine-devel mailing list