OSDN Git Service

glsl: Allow glsl_types.h to be included in C sources
authorIan Romanick <ian.d.romanick@intel.com>
Tue, 11 Oct 2011 23:11:40 +0000 (16:11 -0700)
committerIan Romanick <ian.d.romanick@intel.com>
Mon, 7 Nov 2011 21:33:15 +0000 (13:33 -0800)
Some C code will want access to the glsl_base_type and
glsl_sampler_dim enums in the near future.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Tested-by: Tom Stellard <thomas.stellard@amd.com>
src/glsl/glsl_types.h

index 56b8efe..efbf335 100644 (file)
 #include <string.h>
 #include <assert.h>
 
-extern "C" {
-#include "GL/gl.h"
-}
-
-#include "ralloc.h"
-
 struct _mesa_glsl_parse_state;
 struct glsl_symbol_table;
 
-extern "C" void
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+extern void
 _mesa_glsl_initialize_types(struct _mesa_glsl_parse_state *state);
 
-extern "C" void
+extern void
 _mesa_glsl_release_types(void);
 
+#ifdef __cplusplus
+}
+#endif
+
 enum glsl_base_type {
    GLSL_TYPE_UINT = 0,
    GLSL_TYPE_INT,
@@ -66,6 +68,9 @@ enum glsl_sampler_dim {
    GLSL_SAMPLER_DIM_EXTERNAL
 };
 
+#ifdef __cplusplus
+#include "GL/gl.h"
+#include "ralloc.h"
 
 struct glsl_type {
    GLenum gl_type;
@@ -530,4 +535,6 @@ struct glsl_struct_field {
    const char *name;
 };
 
+#endif /* __cplusplus */
+
 #endif /* GLSL_TYPES_H */