Re: [PATCH 5/5] d3dx9_36/tests: Use NAN.
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(a)free.fr> http://fgouget.free.fr/ The nice thing about meditation is that it makes doing nothing quite respectable -- Paul Dean
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Am 2014-01-03 20:39, schrieb Francois Gouget:
But independently from that I think it's wrong because one should be able to compile the conformance tests on Windows. The purpose of this patch was to be able to compile the tests in msvc. But there may be some quirks in the build setup, see below.
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? NAN was available, and I assumed that I got the one from port.h. Admittedly I didn't check where exactly it came from. Maybe msvc 2013 added a NAN definition.
My msvc build setup is a bit quirky. I wanted to avoid needing a full mingw setup, so I ended up (over time, adding one detail after another) cloning a part of the Wine build system as a msvc project. I'll boot Windows and see where the NAN comes from exactly. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQIcBAEBAgAGBQJSxyh6AAoJEN0/YqbEcdMw1IoP/1XIKj13LgyQTLznU3wzwgNx s3lt2S02Y1Im35dWig6ekCIIB4AriFIZ/mMPCXCxwbadklxXe7w/Y8bjDG+o+lCy rtIRnveotgtSSF8G6MMtIByDWhro1EeYRv93YXpjIZsIJTg50GWUxf61RLh6YFII 5Y4VRS8pBg3+UgVHGgutHqrbuGIuJo0Dk7eVpMjwOSMkseH/egvjqWVuJRe/aTAm cMkIGi78i9XwICKiMoXODin6Ipv3KMxul0uNTHJYcc7QqUdRt/US8ME5B2UJr6ek BjkGthNrOEvQl+EjBz5HaX5pLuUUWGDH/PfVwiPMm9jC0oCDVGuTnCweA964cSZE msdImJOJ1rrOIFT+Xk4YZkIjMf/Mr7TYKNCUoBJVNb4SP+pJNvyfBgWx/s9bGMo4 7DZvIRGXCrZqmvK0e0Q3JyPohW4jMYIOei6yxBK5OtctnxO7MmuOQIYC/XVxGbJH E/KjqbLsk/xwYavXNbirn1kS97neyEgguPZCXg1/lVCPHlmRu+96BmHlf5RvwzUb BGvSjm0WsmBcsDj/Fa5D8Q6n586oeek9q2KTGGwq5wPxLtznq/eArR/U0u9JACGR +7fxFRkjdHJvtKaLohw4B/AOTijRiDwg1iMxGecpqye5Grg7JAKsjcA3EcTxsX3S /ssXcB1sNA2wuAT6CJwU =ScXv -----END PGP SIGNATURE-----
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Am 2014-01-03 22:15, schrieb Stefan Dösinger:
NAN was available, and I assumed that I got the one from port.h. Admittedly I didn't check where exactly it came from. Maybe msvc 2013 added a NAN definition. I got the NAN definition from the system math.h, which is included unconditionally by d3dx9math.h, which is included by d3dx9.h, which is included by the test. NAN is defined as INFINITY * 0.0.
So I guess a NAN definition was introduced in the Windows headers at some point. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQIcBAEBAgAGBQJSxyx+AAoJEN0/YqbEcdMwfuoP/1MWm9B+BPW7Z5XgeW535YdN WUdwDOj3ltBJ/JT1DRW7UyfFoff1ZHWG5s0WI3Tc2RdvkNlZJO+OkqY58uH7fEFk 0hW9MgMaAzfbWbZKExFm99bQYMWseYkoarA5v+1yMW/jj2f/+rsJmyg4FKlKaATX iN54cS9/P4W4lrrHf8/eyl6IiC5y1MeufdRgL4wKuyry1zUCGcsjtQwbWmBnWDl7 Y+MJx/G8iqXcCS25RbjXIuSC+1q4rtfD26hPPgkYjaZ9Kk7uyHpUHd4sOpzvr7zc KkB0h6+IdvM7H92ku4z0XBtKCO5/D++5T91CdegulGAQ57Q/G4xkU5VD4SwqyuYF vGI5B8gkpQE20B2TIRJDaBEmCH59wgHYFsGsGtD0rTXO0mm5eQuHI0PMnh89l28t sBLwek5RmxPxlhNYTtOBog+b5L1nexn1Fzo9svD/jPu8dskfz5ydocPEK+7IX99t I66chDh6zmtgLSNvjfk+9zRR1t4LbIh+c6hqZbs46j4bb325X2BPfoF6E73uoAHB Lo08fsn11It0EyK/u4/Gyi6KwCxhpsXnn+/dRUB8vesY4eHOvFhfQyDBT7G1cFT6 w7sV00CTTGJEVJY745/sf/djIRinlRQXC2se+cH0dUncac+kEyDotaQJOnjMCVAr 1wpIwgC/9jlQCC8n1naL =34Zm -----END PGP SIGNATURE-----
participants (2)
-
Francois Gouget -
Stefan Dösinger