commit:     59fbcc5eef1b6b865839a8e3d721d0ad6d0ff082
Author:     David Seifert <soap <AT> gentoo <DOT> org>
AuthorDate: Sun Jan 29 09:10:36 2017 +0000
Commit:     David Seifert <soap <AT> gentoo <DOT> org>
CommitDate: Sun Jan 29 09:12:48 2017 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=59fbcc5e

dev-libs/OpenNI2: Rename 'equivalent' to avoid C++14 name clash

Gentoo-bug: 594910

Package-Manager: Portage-2.3.3, Repoman-2.3.1

 dev-libs/OpenNI2/OpenNI2-2.2_beta2.ebuild |   9 +-
 dev-libs/OpenNI2/files/c++14.patch        | 145 ++++++++++++++++++++++++++++++
 2 files changed, 150 insertions(+), 4 deletions(-)

diff --git a/dev-libs/OpenNI2/OpenNI2-2.2_beta2.ebuild 
b/dev-libs/OpenNI2/OpenNI2-2.2_beta2.ebuild
index 0a2acf4..acae8b5 100644
--- a/dev-libs/OpenNI2/OpenNI2-2.2_beta2.ebuild
+++ b/dev-libs/OpenNI2/OpenNI2-2.2_beta2.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2014 Gentoo Foundation
+# Copyright 1999-2017 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 # $Id$
 
@@ -32,19 +32,20 @@ RDEPEND="
        virtual/libudev
        virtual/jpeg:0
        opengl? ( media-libs/freeglut )
-       java? ( >=virtual/jre-1.5 )
+       java? ( >=virtual/jre-1.5:* )
 "
 DEPEND="${RDEPEND}
        dev-lang/python
        doc? ( app-doc/doxygen )
-       java? ( >=virtual/jdk-1.5 )"
+       java? ( >=virtual/jdk-1.5:* )"
 
 src_prepare() {
        epatch \
                "${FILESDIR}/jpeg.patch" \
                "${FILESDIR}/rpath.patch" \
                "${FILESDIR}/soname.patch" \
-               "${FILESDIR}/pthread.patch"
+               "${FILESDIR}/pthread.patch" \
+               "${FILESDIR}/c++14.patch"
 
        rm -rf ThirdParty/LibJPEG
        for i in ThirdParty/PSCommon/BuildSystem/Platform.* ; do

diff --git a/dev-libs/OpenNI2/files/c++14.patch 
b/dev-libs/OpenNI2/files/c++14.patch
new file mode 100644
index 00000000..95343a6
--- /dev/null
+++ b/dev-libs/OpenNI2/files/c++14.patch
@@ -0,0 +1,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

Reply via email to