aboutsummaryrefslogtreecommitdiffstats
path: root/main/wine/0001-d3dx9_36-avoid-using-fabsf-fmaxf.patch
blob: e046af735d213f50fa4865771d5a3deea6f32248 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
From b630b7aa0a086affabfb9533b5c64ef8505768dd Mon Sep 17 00:00:00 2001
From: Natanael Copa <ncopa@alpinelinux.org>
Date: Wed, 28 Sep 2011 06:03:59 +0000
Subject: [PATCH] d3dx9_36: avoid using fabsf/fmaxf
Reply-To: wine-devel <wine-devel@winehq.org>

This fixes compiling on Alpine Linux and other uClibc based distros.

This is related bug 28247 and commit 4cddd5ffdf0c568445365c6c62e7788d7dbbca7d
---
 dlls/d3dx9_36/tests/mesh.c |   14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/dlls/d3dx9_36/tests/mesh.c b/dlls/d3dx9_36/tests/mesh.c
index 6a78e64..c09607f 100644
--- a/dlls/d3dx9_36/tests/mesh.c
+++ b/dlls/d3dx9_36/tests/mesh.c
@@ -6160,7 +6160,7 @@ static void check_vertex_components(int line, int mesh_number, int vertex_number
             {
                 FLOAT *got = (FLOAT*)(got_ptr + decl_ptr->Offset);
                 FLOAT *exp = (FLOAT*)(exp_ptr + decl_ptr->Offset);
-                FLOAT diff = fabsf(*got - *exp);
+                FLOAT diff = abs(*got - *exp);
                 ok_(__FILE__,line)(diff <= FLT_EPSILON, "Mesh %d: Got %f for vertex %d %s, expected %f.\n",
                     mesh_number, *got, vertex_number, usage_strings[decl_ptr->Usage], *exp);
                 break;
@@ -6169,7 +6169,7 @@ static void check_vertex_components(int line, int mesh_number, int vertex_number
             {
                 D3DXVECTOR2 *got = (D3DXVECTOR2*)(got_ptr + decl_ptr->Offset);
                 D3DXVECTOR2 *exp = (D3DXVECTOR2*)(exp_ptr + decl_ptr->Offset);
-                FLOAT diff = fmaxf(fabsf(got->x - exp->x), fabsf(got->y - exp->y));
+                FLOAT diff = max(abs(got->x - exp->x), abs(got->y - exp->y));
                 ok_(__FILE__,line)(diff <= FLT_EPSILON, "Mesh %d: Got (%f, %f) for vertex %d %s, expected (%f, %f).\n",
                     mesh_number, got->x, got->y, vertex_number, usage_strings[decl_ptr->Usage], exp->x, exp->y);
                 break;
@@ -6178,8 +6178,8 @@ static void check_vertex_components(int line, int mesh_number, int vertex_number
             {
                 D3DXVECTOR3 *got = (D3DXVECTOR3*)(got_ptr + decl_ptr->Offset);
                 D3DXVECTOR3 *exp = (D3DXVECTOR3*)(exp_ptr + decl_ptr->Offset);
-                FLOAT diff = fmaxf(fabsf(got->x - exp->x), fabsf(got->y - exp->y));
-                diff = fmaxf(diff, fabsf(got->z - exp->z));
+                FLOAT diff = max(abs(got->x - exp->x), abs(got->y - exp->y));
+                diff = max(diff, abs(got->z - exp->z));
                 ok_(__FILE__,line)(diff <= FLT_EPSILON, "Mesh %d: Got (%f, %f, %f) for vertex %d %s, expected (%f, %f, %f).\n",
                     mesh_number, got->x, got->y, got->z, vertex_number, usage_strings[decl_ptr->Usage], exp->x, exp->y, exp->z);
                 break;
@@ -6188,9 +6188,9 @@ static void check_vertex_components(int line, int mesh_number, int vertex_number
             {
                 D3DXVECTOR4 *got = (D3DXVECTOR4*)(got_ptr + decl_ptr->Offset);
                 D3DXVECTOR4 *exp = (D3DXVECTOR4*)(exp_ptr + decl_ptr->Offset);
-                FLOAT diff = fmaxf(fabsf(got->x - exp->x), fabsf(got->y - exp->y));
-                diff = fmaxf(diff, fabsf(got->z - exp->z));
-                diff = fmaxf(diff, fabsf(got->w - exp->w));
+                FLOAT diff = max(abs(got->x - exp->x), abs(got->y - exp->y));
+                diff = max(diff, abs(got->z - exp->z));
+                diff = max(diff, abs(got->w - exp->w));
                 ok_(__FILE__,line)(diff <= FLT_EPSILON, "Mesh %d: Got (%f, %f, %f, %f) for vertex %d %s, expected (%f, %f, %f, %f).\n",
                     mesh_number, got->x, got->y, got->z, got->w, vertex_number, usage_strings[decl_ptr->Usage], exp->x, exp->y, exp->z, got->w);
                 break;
-- 
1.7.6.1