[Bf-blender-cvs] [a77175c9b6c] master: GPU: Add extern "C" to intern headers

Clément Foucault noreply at git.blender.org
Sun Jul 26 17:30:01 CEST 2020


Commit: a77175c9b6c06dadc1df3c654e0e000140a53a39
Author: Clément Foucault
Date:   Sat Jul 25 18:10:43 2020 +0200
Branches: master
https://developer.blender.org/rBa77175c9b6c06dadc1df3c654e0e000140a53a39

GPU: Add extern "C" to intern headers

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

M	source/blender/gpu/intern/gpu_attr_binding_private.h
M	source/blender/gpu/intern/gpu_codegen.h
M	source/blender/gpu/intern/gpu_primitive_private.h
M	source/blender/gpu/intern/gpu_private.h
M	source/blender/gpu/intern/gpu_shader_private.h
M	source/blender/gpu/intern/gpu_vertex_format_private.h

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

diff --git a/source/blender/gpu/intern/gpu_attr_binding_private.h b/source/blender/gpu/intern/gpu_attr_binding_private.h
index 301ec3333dd..7df403a3ea5 100644
--- a/source/blender/gpu/intern/gpu_attr_binding_private.h
+++ b/source/blender/gpu/intern/gpu_attr_binding_private.h
@@ -29,6 +29,11 @@
 #include "GPU_shader_interface.h"
 #include "GPU_vertex_format.h"
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* TODO(fclem) remove, use shaderface directly. */
 void AttrBinding_clear(GPUAttrBinding *binding);
 
 void get_attr_locations(const GPUVertFormat *format,
@@ -36,4 +41,8 @@ void get_attr_locations(const GPUVertFormat *format,
                         const GPUShaderInterface *shaderface);
 uint read_attr_location(const GPUAttrBinding *binding, uint a_idx);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* __GPU_ATTR_BINDING_PRIVATE_H__ */
diff --git a/source/blender/gpu/intern/gpu_codegen.h b/source/blender/gpu/intern/gpu_codegen.h
index ce20f495ba3..18ff4c3241d 100644
--- a/source/blender/gpu/intern/gpu_codegen.h
+++ b/source/blender/gpu/intern/gpu_codegen.h
@@ -26,6 +26,10 @@
 #ifndef __GPU_CODEGEN_H__
 #define __GPU_CODEGEN_H__
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 struct GPUMaterial;
 struct GPUNodeGraph;
 struct GPUOutput;
@@ -68,4 +72,8 @@ void GPU_pass_release(GPUPass *pass);
 void gpu_codegen_init(void);
 void gpu_codegen_exit(void);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* __GPU_CODEGEN_H__ */
diff --git a/source/blender/gpu/intern/gpu_primitive_private.h b/source/blender/gpu/intern/gpu_primitive_private.h
index abefa6abd20..b7d7b262128 100644
--- a/source/blender/gpu/intern/gpu_primitive_private.h
+++ b/source/blender/gpu/intern/gpu_primitive_private.h
@@ -26,6 +26,15 @@
 #ifndef __GPU_PRIMITIVE_PRIVATE_H__
 #define __GPU_PRIMITIVE_PRIVATE_H__
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* TODO(fclem) move to OGL backend */
 GLenum convert_prim_type_to_gl(GPUPrimType);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* __GPU_PRIMITIVE_PRIVATE_H__ */
diff --git a/source/blender/gpu/intern/gpu_private.h b/source/blender/gpu/intern/gpu_private.h
index 7846bff87f4..ed729dd399c 100644
--- a/source/blender/gpu/intern/gpu_private.h
+++ b/source/blender/gpu/intern/gpu_private.h
@@ -21,6 +21,10 @@
 #ifndef __GPU_PRIVATE_H__
 #define __GPU_PRIVATE_H__
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /* call this before running any of the functions below */
 void gpu_platform_init(void);
 void gpu_platform_exit(void);
@@ -41,4 +45,8 @@ void gpu_framebuffer_module_exit(void);
 void gpu_pbvh_init(void);
 void gpu_pbvh_exit(void);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* __GPU_PRIVATE_H__ */
diff --git a/source/blender/gpu/intern/gpu_shader_private.h b/source/blender/gpu/intern/gpu_shader_private.h
index e4443e79a8d..e28c5f76426 100644
--- a/source/blender/gpu/intern/gpu_shader_private.h
+++ b/source/blender/gpu/intern/gpu_shader_private.h
@@ -24,6 +24,10 @@
 #include "GPU_glew.h"
 #include "GPU_shader_interface.h"
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 struct GPUShader {
   /** Handle for full program (links shader stages below). */
   GLuint program;
@@ -47,4 +51,8 @@ struct GPUShader {
 /* XXX do not use it. Special hack to use OCIO with batch API. */
 void immGetProgram(GLuint *program, GPUShaderInterface **shaderface);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* __GPU_SHADER_PRIVATE_H__ */
diff --git a/source/blender/gpu/intern/gpu_vertex_format_private.h b/source/blender/gpu/intern/gpu_vertex_format_private.h
index a850d17a1dd..22373a6394a 100644
--- a/source/blender/gpu/intern/gpu_vertex_format_private.h
+++ b/source/blender/gpu/intern/gpu_vertex_format_private.h
@@ -26,8 +26,16 @@
 #ifndef __GPU_VERTEX_FORMAT_PRIVATE_H__
 #define __GPU_VERTEX_FORMAT_PRIVATE_H__
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 void VertexFormat_pack(GPUVertFormat *format);
 uint padding(uint offset, uint alignment);
 uint vertex_buffer_size(const GPUVertFormat *format, uint vertex_len);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* __GPU_VERTEX_FORMAT_PRIVATE_H__ */



More information about the Bf-blender-cvs mailing list