From 9ca741c64524a57f972ce050919a0e2dec3e64f3 Mon Sep 17 00:00:00 2001 From: Tim Rowley Date: Thu, 16 Jun 2016 21:09:35 -0500 Subject: [PATCH] swr: push/pop DEBUG macro around llvm includes 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" Reviewed-by: Bruce Cherniak --- src/gallium/drivers/swr/swr_shader.cpp | 10 +++++++--- src/gallium/drivers/swr/swr_state.cpp | 7 ++++++- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/src/gallium/drivers/swr/swr_shader.cpp b/src/gallium/drivers/swr/swr_shader.cpp index 8af0700cb04..4d1b604817b 100644 --- a/src/gallium/drivers/swr/swr_shader.cpp +++ b/src/gallium/drivers/swr/swr_shader.cpp @@ -21,14 +21,18 @@ * 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" diff --git a/src/gallium/drivers/swr/swr_state.cpp b/src/gallium/drivers/swr/swr_state.cpp index 31745fca602..5caaa5c7139 100644 --- a/src/gallium/drivers/swr/swr_state.cpp +++ b/src/gallium/drivers/swr/swr_state.cpp @@ -21,9 +21,14 @@ * 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" -- 2.30.2