libmorton
libmorton copied to clipboard
Clang compilation fails on Windows
/build/_deps/libmorton-src/include\libmorton/morton3D.h:149:71: error: expected unqualified-id
C:\Program Files (x86)\Windows Kits\10\Include\10.0.26100.0\shared\minwindef.h:193:29: note: expanded from macro 'max'
193 | #define max(a,b) (((a) > (b)) ? (a) : (b))
| ^
undef 'min' and 'max' macros after including 'intrin.h' header in 'morton_common.h', line 6, seems to fix this issue:
#if defined(_MSC_VER)
#include <intrin.h>
#undef min
#undef max
#endif
this issue does not occur when compiling with MSVC.