[PATCH] d3dx9/tests: Fix compilation when the INFINITY macro is not available.

Józef Kucia jkucia at codeweavers.com
Thu Aug 4 10:52:14 CDT 2016


Signed-off-by: Józef Kucia <jkucia at codeweavers.com>
---

Fixes https://bugs.winehq.org/show_bug.cgi?id=40665

effect.c: In function 'test_effect_preshader_ops':
effect.c:3977: error: 'INFINITY' undeclared (first use in this function)

---
 dlls/d3dx9_36/tests/effect.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/dlls/d3dx9_36/tests/effect.c b/dlls/d3dx9_36/tests/effect.c
index 41db494..b3845c5 100644
--- a/dlls/d3dx9_36/tests/effect.c
+++ b/dlls/d3dx9_36/tests/effect.c
@@ -22,6 +22,15 @@
 #include "wine/test.h"
 #include "d3dx9.h"
 
+#ifndef INFINITY
+static inline float __port_infinity(void)
+{
+    static const unsigned __inf_bytes = 0x7f800000;
+    return *(const float *)&__inf_bytes;
+}
+#define INFINITY __port_infinity()
+#endif /* INFINITY */
+
 #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof(*arr))
 
 /* helper functions */
@@ -4181,7 +4190,7 @@ static void test_preshader_op(IDirect3DDevice9 *device, const DWORD *sample_effe
 
 static void test_effect_preshader_ops(IDirect3DDevice9 *device)
 {
-    static const struct test_preshader_op_def op_tests[] =
+    const struct test_preshader_op_def op_tests[] =
     {
         {"exp", 0x10500001, 1, {0x3f800000, 0x3f800000, 0x3e5edc66, 0x7f800000},
                 {0.0f, -0.0f, -2.2f, 3.402823466e+38f}, {1.0f, 2.0f, -3.0f, 4.0f}},
-- 
2.7.3




More information about the wine-patches mailing list