From dcbcc7ea3c1f557dfdaeaf75e87048f0e6b08199 Mon Sep 17 00:00:00 2001 From: Aleric Inglewood Date: Fri, 13 Sep 2013 17:22:56 +0200 Subject: [PATCH] Avoid compile error when using glh and boost at the same time. Defining a macro in a header that doesn't have any namespace prefix like GLH_ ugh. Very bad. Changed the macro into an inline function inside namespace glh. --- indra/llwindow/glh/glh_linear.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/llwindow/glh/glh_linear.h b/indra/llwindow/glh/glh_linear.h index 04ae1bd06..c46b81531 100644 --- a/indra/llwindow/glh/glh_linear.h +++ b/indra/llwindow/glh/glh_linear.h @@ -71,10 +71,10 @@ glh_linear.h #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) namespace glh { + inline bool equivalent(GLH_REAL a, GLH_REAL b) { return b - GLH_EPSILON < a && a < b + GLH_EPSILON; } inline GLH_REAL to_degrees(GLH_REAL radians) { return radians*GLH_RAD_TO_DEG; } inline GLH_REAL to_radians(GLH_REAL degrees) { return degrees*GLH_DEG_TO_RAD; }