Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix building with GCC-6 #122

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

Peter-Levine
Copy link

Since C++11, there has existed std::error_category::equivalent. OpenNI defines a macro equivalent. During header inclusion, a GCC header calls the function equivalent but that symbol is hidden by the name clash with the macro equivalent leading to:

In file included from ../../../../../Samples/NiViewer/glh/glh_obs.h:62:0,
                 from ../../../../../Samples/NiViewer/NiViewer.cpp:62:
/usr/lib/gcc/x86_64-pc-linux-gnu/6.2.0/include/g++-v6/system_error:107:5: error: expected unqualified-id before ‘int’
     equivalent(int __i, const error_condition& __cond) const noexcept;
     ^

This is easily remedied by changing all instances of macro equivalent to is_equivalent.

Rename the "equivalent()" macro to avoid name clash when buiding with C++11
@rguillome
Copy link

This correction suits well for this error too :
../../../../../Samples/NiViewer/glh/glh_linear.h:80:63: error: no match for ‘operator>’ (operand types are ‘const std::error_code’ and ‘float’) #define equivalent(a,b) (((a < b + GLH_EPSILON) && (a > b - GLH_EPSILON)) ? true : false)
and it's the same as the PR #101

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants