Mesa (glsl-pp-rework-2): glsl/pp: Avoid using `__VERSION__' as an identifier.
MichaŠKról
michal at kemper.freedesktop.org
Thu Sep 24 08:58:10 UTC 2009
Module: Mesa
Branch: glsl-pp-rework-2
Commit: 69fec23251740c3071ffc3fefc8981599bdb22ef
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=69fec23251740c3071ffc3fefc8981599bdb22ef
Author: Michal Krol <michal at vmware.com>
Date: Thu Sep 24 10:57:32 2009 +0200
glsl/pp: Avoid using `__VERSION__' as an identifier.
---
src/glsl/pp/sl_pp_dict.c | 2 +-
src/glsl/pp/sl_pp_dict.h | 5 ++++-
src/glsl/pp/sl_pp_macro.c | 3 ++-
3 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/src/glsl/pp/sl_pp_dict.c b/src/glsl/pp/sl_pp_dict.c
index 0e1fa36..82fb912 100644
--- a/src/glsl/pp/sl_pp_dict.c
+++ b/src/glsl/pp/sl_pp_dict.c
@@ -56,7 +56,7 @@ sl_pp_dict_init(struct sl_pp_context *context)
ADD_NAME_STR(context, ___LINE__, "__LINE__");
ADD_NAME_STR(context, ___FILE__, "__FILE__");
- ADD_NAME(context, __VERSION__);
+ ADD_NAME_STR(context, ___VERSION__, "__VERSION__");
ADD_NAME(context, optimize);
ADD_NAME(context, debug);
diff --git a/src/glsl/pp/sl_pp_dict.h b/src/glsl/pp/sl_pp_dict.h
index 683752e..49f0e0b 100644
--- a/src/glsl/pp/sl_pp_dict.h
+++ b/src/glsl/pp/sl_pp_dict.h
@@ -28,6 +28,9 @@
#ifndef SL_PP_DICT_H
#define SL_PP_DICT_H
+
+struct sl_pp_context;
+
struct sl_pp_dict {
int all;
int _GL_ARB_draw_buffers;
@@ -42,7 +45,7 @@ struct sl_pp_dict {
int ___LINE__;
int ___FILE__;
- int __VERSION__;
+ int ___VERSION__;
int optimize;
int debug;
diff --git a/src/glsl/pp/sl_pp_macro.c b/src/glsl/pp/sl_pp_macro.c
index 3956ba3..a4e7886 100644
--- a/src/glsl/pp/sl_pp_macro.c
+++ b/src/glsl/pp/sl_pp_macro.c
@@ -27,6 +27,7 @@
#include <stdlib.h>
#include <stdio.h>
+#include <string.h>
#include "sl_pp_macro.h"
#include "sl_pp_process.h"
@@ -149,7 +150,7 @@ sl_pp_macro_expand(struct sl_pp_context *context,
(*pi)++;
return 0;
}
- if (macro_name == context->dict.__VERSION__) {
+ if (macro_name == context->dict.___VERSION__) {
if (!mute && _out_number(context, state, 110)) {
return -1;
}
More information about the mesa-commit
mailing list