ir_to_mesa: Move some things outside the 'extern "C"' blocks
authorIan Romanick <ian.d.romanick@intel.com>
Sun, 11 Sep 2011 21:10:33 +0000 (16:10 -0500)
committerIan Romanick <ian.d.romanick@intel.com>
Wed, 19 Oct 2011 00:26:38 +0000 (17:26 -0700)
Having a few of these includes or forward declarations inside the
'extern "C"' block can cause problems later.  Specifically, it
prevents C++ linkage functions from being added to ir_to_mesa.h and
makes G++ angry if 'struct foo' is seen both inside and outside an
'extern "C"'.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/glsl/ir_clone.cpp
src/glsl/ir_print_visitor.cpp
src/glsl/ir_set_program_inouts.cpp
src/mesa/program/ir_to_mesa.cpp
src/mesa/program/ir_to_mesa.h
src/mesa/state_tracker/st_glsl_to_tgsi.cpp

index c1befa95ce96b4bf4ae87dd45bcd3671604bf57e..9adf47050d131935137e6576212db5e8592c0db6 100644 (file)
@@ -25,9 +25,7 @@
 #include "main/compiler.h"
 #include "ir.h"
 #include "glsl_types.h"
-extern "C" {
 #include "program/hash_table.h"
-}
 
 /**
  * Duplicate an IR variable
index ea7858224bb16516b26a8dabd8a875ab5cbc32f6..b713bd03ba0d10afdebf0bc55cf0b39cf8bd8313 100644 (file)
 #include "ir_print_visitor.h"
 #include "glsl_types.h"
 #include "glsl_parser_extras.h"
-
-extern "C" {
 #include "program/hash_table.h"
-}
 
 static void print_type(const glsl_type *t);
 
index 3b10b909724a2dfc833fc8ecbad923626caa643b..ae3ef74c75e0fd25ef4e20cb00b2f66ad3c383a3 100644 (file)
  * from the GLSL IR.
  */
 
-extern "C" {
 #include "main/core.h" /* for struct gl_program */
 #include "program/hash_table.h"
-}
 #include "ir.h"
 #include "ir_visitor.h"
 #include "glsl_types.h"
index 5be44bc514d4b49eefa6710f978fa69c2c24ac0a..8330bc501a22152c49481465996def7d140d7611 100644 (file)
 #include "ir_optimization.h"
 #include "ast.h"
 
-extern "C" {
 #include "main/mtypes.h"
-#include "main/shaderapi.h"
 #include "main/shaderobj.h"
-#include "main/uniforms.h"
 #include "program/hash_table.h"
+
+extern "C" {
+#include "main/shaderapi.h"
+#include "main/uniforms.h"
 #include "program/prog_instruction.h"
 #include "program/prog_optimize.h"
 #include "program/prog_print.h"
index 7410e149735ca3886bf543e3830eb74bc7101727..5649282f03fcd184a507aff91c365a48ef15df6b 100644 (file)
  * DEALINGS IN THE SOFTWARE.
  */
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 #include "main/glheader.h"
 
 struct gl_context;
 struct gl_shader;
 struct gl_shader_program;
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 void _mesa_glsl_compile_shader(struct gl_context *ctx, struct gl_shader *sh);
 void _mesa_glsl_link_shader(struct gl_context *ctx, struct gl_shader_program *prog);
 GLboolean _mesa_ir_compile_shader(struct gl_context *ctx, struct gl_shader *shader);
index 9cc568725363942d8a22403c21d1f2444787d66b..175a0b354b5dac4e58d0bae55b521bdbb4932c9d 100644 (file)
 #include "ir_optimization.h"
 #include "ast.h"
 
-extern "C" {
 #include "main/mtypes.h"
-#include "main/shaderapi.h"
 #include "main/shaderobj.h"
-#include "main/uniforms.h"
 #include "program/hash_table.h"
+
+extern "C" {
+#include "main/shaderapi.h"
+#include "main/uniforms.h"
 #include "program/prog_instruction.h"
 #include "program/prog_optimize.h"
 #include "program/prog_print.h"