[Mesa-dev] [PATCH v2] swr: fix windows build break

George Kyriazis george.kyriazis at intel.com
Wed Jan 4 19:36:08 UTC 2017


wrap lp_native_vector_width around extern "C" for C++.
Windows decorates global variables, so when used from .cpp files, need
to use an undecorated version.
---
 src/gallium/auxiliary/gallivm/lp_bld_type.h | 7 +++++++
 src/gallium/drivers/swr/swr_screen.cpp      | 4 ----
 2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/src/gallium/auxiliary/gallivm/lp_bld_type.h b/src/gallium/auxiliary/gallivm/lp_bld_type.h
index 7fb449f..1d12974 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_type.h
+++ b/src/gallium/auxiliary/gallivm/lp_bld_type.h
@@ -47,7 +47,14 @@
  * Using this width should give the best performance,
  * and it determines the necessary alignment of vector variables.
  */
+#ifdef __cplusplus
+// extern "C" for windows, since msdev decorates global vars
+extern "C" {
 extern unsigned lp_native_vector_width;
+}
+#else
+extern unsigned lp_native_vector_width;
+#endif
 
 /**
  * Maximum supported vector width (not necessarily supported at run-time).
diff --git a/src/gallium/drivers/swr/swr_screen.cpp b/src/gallium/drivers/swr/swr_screen.cpp
index a9905d7..3b010fe 100644
--- a/src/gallium/drivers/swr/swr_screen.cpp
+++ b/src/gallium/drivers/swr/swr_screen.cpp
@@ -39,10 +39,6 @@
 
 #include "state_tracker/sw_winsys.h"
 
-extern "C" {
-#include "gallivm/lp_bld_limits.h"
-}
-
 #include "jit_api.h"
 
 #include "memory/TilingFunctions.h"
-- 
2.10.0.windows.1



More information about the mesa-dev mailing list