OpenNI / OpenNI2

OpenNI2
Apache License 2.0
432 stars 893 forks source link

Compiling OpenNI2-2.0.0.30 on mac with clang fails: macro equivalent() in ThirdParty/GL/glh/glh_linear.h clashes with llvm::sys::fs::equivalent #52

Closed dankegel closed 10 years ago

dankegel commented 10 years ago

I'm guessing here, but the define

define equivalent(a,b) (((a < b + GLH_EPSILON) && (a > b - GLH_EPSILON)) ? true : false)

in OpenNI2-2.2.0.30/ThirdParty/GL/glh/glh_linear.h seems to be causing build failure with clang, possibly because it clashes with llvm::sys::fs::equivalent.

Simply changing equivalent to something else, like glh_equiv, works around the problem. Here's a patch we use for this here:

http://kegel.com/equiv-is-a-thing-for-clang-apparently.patch

ryandesign commented 10 years ago

Yes, I've just had to commit something similar to MacPorts for compatibility with OS X 10.9 Mavericks. Note that this affects openni1 as well as openni2.

eddiecohen commented 10 years ago

Please note that GLH was completely removed from OpenNI in the develop branch.