Include math.h in d3dx9math.inl as it uses sqrt().

Daniel Scharrer dscharrer at
Fri Nov 11 19:38:29 CST 2011

On Fri, Nov 11, 2011 at 12:45, Francois Gouget <fgouget at> wrote:
> On Thu, 10 Nov 2011, Daniel Scharrer wrote:
>> > Does the Microsoft header include math.h?
>> I'm sorry, it seems I made a mistake here: the actual header file
>> (d3dx9math.h) from wine includes math.h so the sqrt usage is ok.
>> However, d3dx9math.inl also uses min and max macros which aren't
>> included anywhere. Because of this a winelib user has to
>> define/include those symbols before including d3dx9math.h (that was my
>> original problem). I'm pretty certain that is not the case for the
>> Microsoft headers.
>> A quick grep of the wine include files shows that the min/max macros
>> are defined in windef.h, minmax.h and msvcrt/stdlib.h - I have no idea
>> which one should be included here.
> At least up to DirectX 9.0c, d3dx9math.h only includes d3dx9.h and
> math.h (and d3dx9math.inl) so that's what we have to work with. But as
> has been pointed out previously, in DirectX 9.0c d3dx9math.inl does not
> use min() and max(). So removing them from our version is probably the
> right fix.

Ok, I've submitted a new patch that removes min/max usage in d3dx9math.inl.


More information about the wine-devel mailing list