[PATCH 5/5] d3dx9_36/tests: Use NAN.

Francois Gouget fgouget at free.fr
Fri Jan 3 13:39:27 CST 2014

On Thu, 2 Jan 2014, Stefan Dösinger wrote:
> --- a/dlls/d3dx9_36/tests/mesh.c
> +++ b/dlls/d3dx9_36/tests/mesh.c
> @@ -4800,7 +4800,7 @@ static void test_create_skin_info(void)
> -            exp_weights[1] = 0.0f / 0.0f; /* NAN */
> +            exp_weights[1] = NAN;

This patch breaks the compilation on Solaris because it does not define 
NAN (except in math_c99.h but we cannot use that, see below).

But independently from that I think it's wrong because one should be 
able to compile the conformance tests on Windows. This means we cannot 
use things like config.h or port.h and should only use stuff that's 
defined in Windows headers. But as far as I can tell the Windows SDK 
does not define NAN. There is a definition of NAN in the CRT xmath.h 
header but Wine does not have that header and we're obviously not 
including it here.

So one solution would be to revert the patch.
Another would be to copy wine/port.h's __port_nan() definition.
Yet another might be to add xmath.h and a dependency on msvcrt.dll.
But maybe there's a better way still?

Francois Gouget <fgouget at free.fr>              http://fgouget.free.fr/
The nice thing about meditation is that it makes doing nothing quite respectable
                                  -- Paul Dean

More information about the wine-devel mailing list