summaryrefslogtreecommitdiff
blob: 95343a60059a2c51bed50b2e971c3622300ccde7 (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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
The 'equivalent' macro clashes with equivalent() member functions of the
std::error_category::equivalent class in C++11 and above.
See also:
https://bugs.gentoo.org/show_bug.cgi?id=594910

--- a/ThirdParty/GL/glh/glh_linear.h
+++ b/ThirdParty/GL/glh/glh_linear.h
@@ -77,7 +77,7 @@
 #define     GLH_EPSILON         GLH_REAL(10e-6)
 #define     GLH_PI              GLH_REAL(3.1415926535897932384626433832795)    
 
-#define     equivalent(a,b)     (((a < b + GLH_EPSILON) && (a > b - GLH_EPSILON)) ? true : false)
+#define     equivalent_(a,b)     (((a < b + GLH_EPSILON) && (a > b - GLH_EPSILON)) ? true : false)
 
 namespace glh
 {
@@ -1093,7 +1093,7 @@
 
         real norm = q[0] * q[0] + q[1] * q[1] + q[2] * q[2] + q[3] * q[3];
 
-        s = (equivalent(norm,GLH_ZERO)) ? GLH_ZERO : ( GLH_TWO / norm );
+        s = (equivalent_(norm,GLH_ZERO)) ? GLH_ZERO : ( GLH_TWO / norm );
 
         xs = q[0] * s;
         ys = q[1] * s;
@@ -1194,7 +1194,7 @@
             theta *= real(0.5);
             real sin_theta = real(sin(theta));
 
-            if (!equivalent(sqnorm,GLH_ONE)) 
+            if (!equivalent_(sqnorm,GLH_ONE)) 
               sin_theta /= real(sqrt(sqnorm));
             x = sin_theta * axis.v[0];
             y = sin_theta * axis.v[1];
@@ -1216,14 +1216,14 @@
 
         alpha = p1.dot(p2);
 
-        if(equivalent(alpha,GLH_ONE))
+        if(equivalent_(alpha,GLH_ONE))
         { 
             *this = identity(); 
             return *this; 
         }
 
         // ensures that the anti-parallel case leads to a positive dot
-        if(equivalent(alpha,-GLH_ONE))
+        if(equivalent_(alpha,-GLH_ONE))
         {
             vec3 v;
 
@@ -1280,7 +1280,7 @@
     void normalize()
     {
         real rnorm = GLH_ONE / real(sqrt(w * w + x * x + y * y + z * z));
-        if (equivalent(rnorm, GLH_ZERO))
+        if (equivalent_(rnorm, GLH_ZERO))
             return;
         x *= rnorm;
         y *= rnorm;
@@ -1439,10 +1439,10 @@
     inline
     bool operator == ( const quaternion & q1, const quaternion & q2 )
     {
-        return (equivalent(q1.x, q2.x) &&
-		        equivalent(q1.y, q2.y) &&
-		        equivalent(q1.z, q2.z) &&
-		        equivalent(q1.w, q2.w) );
+        return (equivalent_(q1.x, q2.x) &&
+		        equivalent_(q1.y, q2.y) &&
+		        equivalent_(q1.z, q2.z) &&
+		        equivalent_(q1.w, q2.w) );
     }
 
     inline
--- a/ThirdParty/PSCommon/XnLib/ThirdParty/GL/glh/glh_linear.h
+++ b/ThirdParty/PSCommon/XnLib/ThirdParty/GL/glh/glh_linear.h
@@ -77,7 +77,7 @@
 #define     GLH_EPSILON         GLH_REAL(10e-6)
 #define     GLH_PI              GLH_REAL(3.1415926535897932384626433832795)    
 
-#define     equivalent(a,b)     (((a < b + GLH_EPSILON) && (a > b - GLH_EPSILON)) ? true : false)
+#define     equivalent_(a,b)     (((a < b + GLH_EPSILON) && (a > b - GLH_EPSILON)) ? true : false)
 
 namespace glh
 {
@@ -1093,7 +1093,7 @@
 
         real norm = q[0] * q[0] + q[1] * q[1] + q[2] * q[2] + q[3] * q[3];
 
-        s = (equivalent(norm,GLH_ZERO)) ? GLH_ZERO : ( GLH_TWO / norm );
+        s = (equivalent_(norm,GLH_ZERO)) ? GLH_ZERO : ( GLH_TWO / norm );
 
         xs = q[0] * s;
         ys = q[1] * s;
@@ -1194,7 +1194,7 @@
             theta *= real(0.5);
             real sin_theta = real(sin(theta));
 
-            if (!equivalent(sqnorm,GLH_ONE)) 
+            if (!equivalent_(sqnorm,GLH_ONE)) 
               sin_theta /= real(sqrt(sqnorm));
             x = sin_theta * axis.v[0];
             y = sin_theta * axis.v[1];
@@ -1216,14 +1216,14 @@
 
         alpha = p1.dot(p2);
 
-        if(equivalent(alpha,GLH_ONE))
+        if(equivalent_(alpha,GLH_ONE))
         { 
             *this = identity(); 
             return *this; 
         }
 
         // ensures that the anti-parallel case leads to a positive dot
-        if(equivalent(alpha,-GLH_ONE))
+        if(equivalent_(alpha,-GLH_ONE))
         {
             vec3 v;
 
@@ -1280,7 +1280,7 @@
     void normalize()
     {
         real rnorm = GLH_ONE / real(sqrt(w * w + x * x + y * y + z * z));
-        if (equivalent(rnorm, GLH_ZERO))
+        if (equivalent_(rnorm, GLH_ZERO))
             return;
         x *= rnorm;
         y *= rnorm;
@@ -1439,10 +1439,10 @@
     inline
     bool operator == ( const quaternion & q1, const quaternion & q2 )
     {
-        return (equivalent(q1.x, q2.x) &&
-		        equivalent(q1.y, q2.y) &&
-		        equivalent(q1.z, q2.z) &&
-		        equivalent(q1.w, q2.w) );
+        return (equivalent_(q1.x, q2.x) &&
+		        equivalent_(q1.y, q2.y) &&
+		        equivalent_(q1.z, q2.z) &&
+		        equivalent_(q1.w, q2.w) );
     }
 
     inline