diff options
author | Mark Janes <[email protected]> | 2015-03-04 16:37:29 -0800 |
---|---|---|
committer | Matt Turner <[email protected]> | 2015-03-05 10:21:40 -0800 |
commit | 237dcb4aa7c39c59bfd225ae3d73caf709be216d (patch) | |
tree | 9139b596ac2383fa3e4ada351b94000ba9319e5f /src/mesa/drivers | |
parent | 2e4c95dfe2cb205c327ceaa12b44a9273bdb20dc (diff) |
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 <[email protected]>
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 6b9a900748d..385ccb8dd1b 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 533feb4c7a6..d6acc238a1a 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 c64742cb6f9..933fdde24f9 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 cbe61910b4e..02ea3b6d7c5 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 03e5fdbef2c..01d3a569858 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 57c4d66b8ad..6b48f701fba 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 ec3cfcbd255..f2b4d824218 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 a286f8ace77..31868240a0a 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 f54530f370b..32d1ce369d4 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 |