gallivm: Workaround LLVM PR23628.
authorJose Fonseca <jfonseca@vmware.com>
Thu, 28 May 2015 09:11:36 +0000 (10:11 +0100)
committerJose Fonseca <jfonseca@vmware.com>
Thu, 28 May 2015 09:12:55 +0000 (10:12 +0100)
Temporarily undefine DEBUG macro while including LLVM C++ headers,
leveraging the push/pop_macro pragmas, which are supported both by GCC
and MSVC.

https://bugs.freedesktop.org/show_bug.cgi?id=90621

Trivial.

src/gallium/auxiliary/gallivm/lp_bld_misc.cpp

index ffed9e6b69a1406f67af2ddf1d79f1f4fbcaa8a5..5e25819ac5578fa1bd06b3400b161fa14f001796 100644 (file)
 
 #include <stddef.h>
 
+// Workaround http://llvm.org/PR23628
+#if HAVE_LLVM >= 0x0307
+#  pragma push_macro("DEBUG")
+#  undef DEBUG
+#endif
+
 #include <llvm-c/Core.h>
 #include <llvm-c/ExecutionEngine.h>
 #include <llvm/Target/TargetOptions.h>
 #include <llvm/IR/Module.h>
 #include <llvm/Support/CBindingWrapping.h>
 
+// Workaround http://llvm.org/PR23628
+#if HAVE_LLVM >= 0x0307
+#  pragma pop_macro("DEBUG")
+#endif
+
 #include "pipe/p_config.h"
 #include "util/u_debug.h"
 #include "util/u_cpu_detect.h"