swr: push/pop DEBUG macro around llvm includes
authorTim Rowley <timothy.o.rowley@intel.com>
Fri, 17 Jun 2016 02:09:35 +0000 (21:09 -0500)
committerTim Rowley <timothy.o.rowley@intel.com>
Thu, 23 Jun 2016 14:58:08 +0000 (09:58 -0500)
llvm redefines DEBUG; adding push/pop prevents a undefined reference
to debug_refcnt_state in llvm-3.7+.

v2: add undef DEBUG

Cc: "12.0" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Bruce Cherniak <bruce.cherniak@intel.com>
src/gallium/drivers/swr/swr_shader.cpp
src/gallium/drivers/swr/swr_state.cpp

index 8af0700cb04c7555b127566d3368ba711195ea80..4d1b604817b430e2c1abd47bcaa52839bae7c003 100644 (file)
  * IN THE SOFTWARE.
  ***************************************************************************/
 
+// llvm redefines DEBUG
+#pragma push_macro("DEBUG")
+#undef DEBUG
 #include "JitManager.h"
+#include "llvm-c/Core.h"
+#include "llvm/Support/CBindingWrapping.h"
+#pragma pop_macro("DEBUG")
+
 #include "state.h"
 #include "state_llvm.h"
 #include "builder.h"
 
-#include "llvm-c/Core.h"
-#include "llvm/Support/CBindingWrapping.h"
-
 #include "tgsi/tgsi_strings.h"
 #include "gallivm/lp_bld_init.h"
 #include "gallivm/lp_bld_flow.h"
index 31745fca6027574c84f97d8bab62e5b5009ea649..5caaa5c7139de654f711901b4e02a1dbe3e8c5cc 100644 (file)
  * IN THE SOFTWARE.
  ***************************************************************************/
 
+// llvm redefines DEBUG
+#pragma push_macro("DEBUG")
+#undef DEBUG
+#include "JitManager.h"
+#pragma pop_macro("DEBUG")
+
 #include "common/os.h"
 #include "jit_api.h"
-#include "JitManager.h"
 #include "state_llvm.h"
 
 #include "gallivm/lp_bld_tgsi.h"