#ifndef GLSL_PARSER_EXTRAS_H
#define GLSL_PARSER_EXTRAS_H
+/*
+ * Most of the definitions here only apply to C++
+ */
+#ifdef __cplusplus
+
+
#include <cstdlib>
#include "glsl_symbol_table.h"
_mesa_glsl_parse_state *state,
const char *fmt, ...);
-extern "C" {
-extern int preprocess(void *ctx, const char **shader, char **info_log,
- const struct gl_extensions *extensions);
-
-extern void _mesa_destroy_shader_compiler();
-extern void _mesa_destroy_shader_compiler_caches();
-}
-
extern void _mesa_glsl_lexer_ctor(struct _mesa_glsl_parse_state *state,
const char *string);
extern const char *
_mesa_glsl_shader_target_name(enum _mesa_glsl_parser_targets target);
+
+#endif /* __cplusplus */
+
+
+/*
+ * These definitions apply to C and C++
+ */
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+extern int preprocess(void *ctx, const char **shader, char **info_log,
+ const struct gl_extensions *extensions);
+
+extern void _mesa_destroy_shader_compiler();
+extern void _mesa_destroy_shader_compiler_caches();
+
+#ifdef __cplusplus
+}
+#endif
+
+
#endif /* GLSL_PARSER_EXTRAS_H */