intel: Add extern "C" declarations to headers
authorPaul Berry <stereotype441@gmail.com>
Fri, 27 Apr 2012 14:40:34 +0000 (07:40 -0700)
committerPaul Berry <stereotype441@gmail.com>
Thu, 10 May 2012 17:30:00 +0000 (10:30 -0700)
These declarations are necessary to allow C++ code to call C code
without causing unresolved symbols (which would make the driver fail
to load).

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
src/mesa/drivers/dri/i965/brw_context.h
src/mesa/drivers/dri/i965/brw_eu.h
src/mesa/drivers/dri/i965/brw_state.h
src/mesa/drivers/dri/i965/gen6_hiz.h
src/mesa/drivers/dri/i965/gen7_hiz.h
src/mesa/drivers/dri/intel/intel_batchbuffer.h
src/mesa/drivers/dri/intel/intel_context.h
src/mesa/drivers/dri/intel/intel_fbo.h
src/mesa/drivers/dri/intel/intel_mipmap_tree.h
src/mesa/drivers/dri/intel/intel_regions.h
src/mesa/main/teximage.h

index 47f56e2..141fb65 100644 (file)
@@ -37,6 +37,9 @@
 #include "brw_structs.h"
 #include "main/imports.h"
 
+#ifdef __cplusplus
+extern "C" {
+#endif
 
 /* Glossary:
  *
@@ -1188,4 +1191,8 @@ brw_program_reloc(struct brw_context *brw, uint32_t state_offset,
 
 bool brw_do_cubemap_normalize(struct exec_list *instructions);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif
index c4c62b2..675b50a 100644 (file)
 #include "brw_defines.h"
 #include "program/prog_instruction.h"
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #define BRW_SWIZZLE4(a,b,c,d) (((a)<<0) | ((b)<<2) | ((c)<<4) | ((d)<<6))
 #define BRW_GET_SWZ(swz, idx) (((swz) >> ((idx)*2)) & 0x3)
 
@@ -1107,4 +1111,8 @@ void brw_optimize(struct brw_compile *p);
 void brw_remove_duplicate_mrf_moves(struct brw_compile *p);
 void brw_remove_grf_to_mrf_moves(struct brw_compile *p);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif
index 8a0e92f..659cb0a 100644 (file)
 
 #include "brw_context.h"
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 extern const struct brw_tracked_state brw_blend_constant_color;
 extern const struct brw_tracked_state brw_cc_vp;
 extern const struct brw_tracked_state brw_cc_unit;
@@ -208,4 +212,8 @@ uint32_t
 get_attr_override(struct brw_vue_map *vue_map, int urb_entry_read_offset,
                   int fs_attr, bool two_side_color);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif
index 0a13ba0..5d6eefc 100644 (file)
 
 #include <stdint.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 struct intel_context;
 struct intel_mipmap_tree;
 
@@ -77,3 +81,7 @@ gen6_resolve_depth_slice(struct intel_context *intel,
                          struct intel_mipmap_tree *mt,
                          uint32_t level,
                          uint32_t layer);
+
+#ifdef __cplusplus
+}
+#endif
index b89ffb0..6c0fc84 100644 (file)
 
 #include <stdint.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 struct intel_context;
 struct intel_mipmap_tree;
 
@@ -41,3 +45,7 @@ gen7_resolve_depth_slice(struct intel_context *intel,
                          struct intel_mipmap_tree *mt,
                          uint32_t level,
                          uint32_t layer);
+
+#ifdef __cplusplus
+}
+#endif
index 751ec99..50d0d28 100644 (file)
@@ -7,6 +7,10 @@
 #include "intel_bufmgr.h"
 #include "intel_reg.h"
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #define BATCH_RESERVED 16
 
 void intel_batchbuffer_init(struct intel_context *intel);
@@ -152,4 +156,8 @@ void intel_batchbuffer_cached_advance(struct intel_context *intel);
 #define ADVANCE_BATCH() intel_batchbuffer_advance(intel);
 #define CACHED_BATCH() intel_batchbuffer_cached_advance(intel);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif
index 8ba7270..63dba89 100644 (file)
@@ -49,7 +49,6 @@ extern "C" {
 
 #ifdef __cplusplus
        #undef virtual
-}
 #endif
 
 #include "tnl/t_vertex.h"
@@ -607,4 +606,8 @@ is_power_of_two(uint32_t value)
    return (value & (value - 1)) == 0;
 }
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif
index 947944a..758b4a0 100644 (file)
 #include "intel_context.h"
 #include "intel_screen.h"
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 struct intel_context;
 struct intel_mipmap_tree;
 struct intel_texture_image;
@@ -197,4 +201,8 @@ bool
 intel_renderbuffer_resolve_depth(struct intel_context *intel,
                                 struct intel_renderbuffer *irb);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* INTEL_FBO_H */
index 9082864..0886c95 100644 (file)
 #include "intel_regions.h"
 #include "intel_resolve_map.h"
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /* A layer on top of the intel_regions code which adds:
  *
  * - Code to size and layout a region to hold a set of mipmaps.
@@ -413,4 +417,8 @@ intel_miptree_unmap(struct intel_context *intel,
                    unsigned int level,
                    unsigned int slice);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif
index 0a05d79..2fb30eb 100644 (file)
 #include "main/mtypes.h"
 #include "intel_bufmgr.h"
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 struct intel_context;
 struct intel_buffer_object;
 
@@ -147,4 +151,8 @@ struct __DRIimageRec {
    void *data;
 };
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif
index e2bdaca..66a0c88 100644 (file)
@@ -35,6 +35,9 @@
 #include "mtypes.h"
 #include "formats.h"
 
+#ifdef __cplusplus
+extern "C" {
+#endif
 
 /** Is the given value one of the 6 cube faces? */
 static inline GLboolean
@@ -287,4 +290,8 @@ _mesa_TexBuffer(GLenum target, GLenum internalFormat, GLuint buffer);
 
 /*@}*/
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif