[Bf-blender-cvs] [4f961901226] master: Fix: Build issue with MSVC

Ray Molenkamp noreply at git.blender.org
Fri Apr 8 20:52:40 CEST 2022


Commit: 4f961901226470446bb6de9ac3d8469ff3453671
Author: Ray Molenkamp
Date:   Fri Apr 8 12:52:35 2022 -0600
Branches: master
https://developer.blender.org/rB4f961901226470446bb6de9ac3d8469ff3453671

Fix: Build issue with MSVC

draw_common.h was included in a C++ file
leading to the linker looking for the
decorated name for `G_draw` which lead
to a linker error.

adding an extern "C" for C++ fixes
the issue.

===================================================================

M	source/blender/draw/intern/draw_common.h

===================================================================

diff --git a/source/blender/draw/intern/draw_common.h b/source/blender/draw/intern/draw_common.h
index e2dc91f64be..34b930ae9c8 100644
--- a/source/blender/draw/intern/draw_common.h
+++ b/source/blender/draw/intern/draw_common.h
@@ -9,6 +9,10 @@
 
 #include "draw_common_shader_shared.h"
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 struct DRWShadingGroup;
 struct FluidModifierData;
 struct GPUMaterial;
@@ -92,3 +96,7 @@ struct DRW_Global {
   struct GPUUniformBuf *view_ubo;
 };
 extern struct DRW_Global G_draw;
+
+#ifdef __cplusplus
+}
+#endif



More information about the Bf-blender-cvs mailing list