i965: add extern C notation in headers
authorEmil Velikov <emil.velikov@collabora.com>
Thu, 16 Feb 2017 15:16:40 +0000 (15:16 +0000)
committerEmil Velikov <emil.l.velikov@gmail.com>
Tue, 21 Feb 2017 18:29:28 +0000 (18:29 +0000)
Otherwise symbols wont be annotated with C linkage and we'll fail at
link time.

Currently this is worked around by wrapping the header inclusion itself.
The latter in itself fragile and not recommended.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
src/mesa/drivers/dri/i965/intel_debug.h
src/mesa/drivers/dri/i965/intel_screen.h
src/mesa/drivers/dri/i965/intel_tex_obj.h

index afca36eb33c6c24d9ecde473e5ac69e548550441..e8e329bc60d4075bf09d573748f2e93a9ed71b3c 100644 (file)
@@ -24,6 +24,9 @@
  */
 #pragma once
 
+#ifdef __cplusplus
+extern "C" {
+#endif
 /**
  * \file intel_debug.h
  *
@@ -122,3 +125,7 @@ extern uint64_t INTEL_DEBUG;
 extern uint64_t intel_debug_flag_for_shader_stage(gl_shader_stage stage);
 
 extern void brw_process_intel_debug_variable(void);
+
+#ifdef __cplusplus
+}
+#endif
index a1e2b31774c874e89476f3d5acc022b38697fce7..147af257beb26ad18c5d92a085ac31b40bb652b3 100644 (file)
 #include "i915_drm.h"
 #include "xmlconfig.h"
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 struct intel_screen
 {
    int deviceID;
@@ -154,4 +158,8 @@ can_do_predicate_writes(const struct intel_screen *screen)
    return screen->kernel_features & KERNEL_ALLOWS_PREDICATE_WRITES;
 }
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif
index 844aad1ab3083e310d3878578b5c11e897573038..27c18b7c3ceeb12565c7fffbdd51d48305aec640 100644 (file)
@@ -28,6 +28,9 @@
 
 #include "swrast/s_context.h"
 
+#ifdef __cplusplus
+extern "C" {
+#endif
 
 struct intel_texture_object
 {
@@ -90,4 +93,8 @@ intel_texture_image(struct gl_texture_image *img)
    return (struct intel_texture_image *) img;
 }
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* _INTEL_TEX_OBJ_H */