diff options
author | Mark Janes <mark.a.janes@intel.com> | 2015-03-04 16:37:29 -0800 |
---|---|---|
committer | Matt Turner <mattst88@gmail.com> | 2015-03-05 10:21:40 -0800 |
commit | 237dcb4aa7c39c59bfd225ae3d73caf709be216d (patch) | |
tree | 9139b596ac2383fa3e4ada351b94000ba9319e5f /src/mesa/drivers | |
parent | 2e4c95dfe2cb205c327ceaa12b44a9273bdb20dc (diff) | |
download | external_mesa3d-237dcb4aa7c39c59bfd225ae3d73caf709be216d.zip external_mesa3d-237dcb4aa7c39c59bfd225ae3d73caf709be216d.tar.gz external_mesa3d-237dcb4aa7c39c59bfd225ae3d73caf709be216d.tar.bz2 |
Fix invalid extern "C" around header inclusion.
System headers may contain C++ declarations, which cannot be given C
linkage. For this reason, include statements should never occur
inside extern "C".
This patch moves the C linkage statements to enclose only the
declarations within a single header.
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Diffstat (limited to 'src/mesa/drivers')
-rw-r--r-- | src/mesa/drivers/common/driverfuncs.h | 7 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_fs.cpp | 3 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_fs_channel_expressions.cpp | 2 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_fs_generator.cpp | 3 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_fs_vector_splitting.cpp | 2 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_fs_visitor.cpp | 3 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_shader.cpp | 2 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_vec4_reg_allocate.cpp | 3 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_wm.h | 8 |
9 files changed, 15 insertions, 18 deletions
diff --git a/src/mesa/drivers/common/driverfuncs.h b/src/mesa/drivers/common/driverfuncs.h index 6b9a900..385ccb8 100644 --- a/src/mesa/drivers/common/driverfuncs.h +++ b/src/mesa/drivers/common/driverfuncs.h @@ -26,6 +26,10 @@ #ifndef DRIVERFUNCS_H #define DRIVERFUNCS_H +#ifdef __cplusplus +extern "C" { +#endif + extern void _mesa_init_driver_functions(struct dd_function_table *driver); @@ -33,5 +37,8 @@ _mesa_init_driver_functions(struct dd_function_table *driver); extern void _mesa_init_driver_state(struct gl_context *ctx); +#ifdef __cplusplus +} // extern "C" +#endif #endif diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp index 533feb4..d6acc23 100644 --- a/src/mesa/drivers/dri/i965/brw_fs.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs.cpp @@ -28,8 +28,6 @@ * from the LIR. */ -extern "C" { - #include <sys/types.h> #include "util/hash_table.h" @@ -43,7 +41,6 @@ extern "C" { #include "brw_context.h" #include "brw_eu.h" #include "brw_wm.h" -} #include "brw_fs.h" #include "brw_cfg.h" #include "brw_dead_control_flow.h" diff --git a/src/mesa/drivers/dri/i965/brw_fs_channel_expressions.cpp b/src/mesa/drivers/dri/i965/brw_fs_channel_expressions.cpp index c64742c..933fdde 100644 --- a/src/mesa/drivers/dri/i965/brw_fs_channel_expressions.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs_channel_expressions.cpp @@ -41,10 +41,8 @@ * we do retain the vector types in that case. */ -extern "C" { #include "main/core.h" #include "brw_wm.h" -} #include "glsl/ir.h" #include "glsl/ir_expression_flattening.h" #include "glsl/glsl_types.h" diff --git a/src/mesa/drivers/dri/i965/brw_fs_generator.cpp b/src/mesa/drivers/dri/i965/brw_fs_generator.cpp index cbe6191..02ea3b6 100644 --- a/src/mesa/drivers/dri/i965/brw_fs_generator.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs_generator.cpp @@ -27,12 +27,9 @@ * native instructions. */ -extern "C" { #include "main/macros.h" #include "brw_context.h" #include "brw_eu.h" -} /* extern "C" */ - #include "brw_fs.h" #include "brw_cfg.h" diff --git a/src/mesa/drivers/dri/i965/brw_fs_vector_splitting.cpp b/src/mesa/drivers/dri/i965/brw_fs_vector_splitting.cpp index 03e5fdb..01d3a56 100644 --- a/src/mesa/drivers/dri/i965/brw_fs_vector_splitting.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs_vector_splitting.cpp @@ -37,10 +37,8 @@ * behavior we want for the results of texture lookups, but probably not for */ -extern "C" { #include "main/core.h" #include "brw_context.h" -} #include "glsl/ir.h" #include "glsl/ir_visitor.h" #include "glsl/ir_rvalue_visitor.h" diff --git a/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp b/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp index 57c4d66..6b48f70 100644 --- a/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp @@ -27,8 +27,6 @@ * makes it easier to do backend-specific optimizations than doing so * in the GLSL IR or in the native code. */ -extern "C" { - #include <sys/types.h> #include "main/macros.h" @@ -41,7 +39,6 @@ extern "C" { #include "brw_context.h" #include "brw_eu.h" #include "brw_wm.h" -} #include "brw_vec4.h" #include "brw_fs.h" #include "main/uniforms.h" diff --git a/src/mesa/drivers/dri/i965/brw_shader.cpp b/src/mesa/drivers/dri/i965/brw_shader.cpp index ec3cfcb..f2b4d82 100644 --- a/src/mesa/drivers/dri/i965/brw_shader.cpp +++ b/src/mesa/drivers/dri/i965/brw_shader.cpp @@ -21,10 +21,8 @@ * IN THE SOFTWARE. */ -extern "C" { #include "main/macros.h" #include "brw_context.h" -} #include "brw_vs.h" #include "brw_gs.h" #include "brw_fs.h" diff --git a/src/mesa/drivers/dri/i965/brw_vec4_reg_allocate.cpp b/src/mesa/drivers/dri/i965/brw_vec4_reg_allocate.cpp index a286f8a..3186824 100644 --- a/src/mesa/drivers/dri/i965/brw_vec4_reg_allocate.cpp +++ b/src/mesa/drivers/dri/i965/brw_vec4_reg_allocate.cpp @@ -21,11 +21,8 @@ * IN THE SOFTWARE. */ -extern "C" { #include "main/macros.h" #include "util/register_allocate.h" -} /* extern "C" */ - #include "brw_vec4.h" #include "brw_vs.h" #include "brw_cfg.h" diff --git a/src/mesa/drivers/dri/i965/brw_wm.h b/src/mesa/drivers/dri/i965/brw_wm.h index f54530f..32d1ce3 100644 --- a/src/mesa/drivers/dri/i965/brw_wm.h +++ b/src/mesa/drivers/dri/i965/brw_wm.h @@ -57,6 +57,10 @@ #define AA_SOMETIMES 1 #define AA_ALWAYS 2 +#ifdef __cplusplus +extern "C" { +#endif + /** * Compile a fragment shader. * @@ -86,4 +90,8 @@ bool brw_wm_prog_data_compare(const void *a, const void *b); void brw_upload_wm_prog(struct brw_context *brw); +#ifdef __cplusplus +} // extern "C" +#endif + #endif |