Add predefined macro GL_ES
Signed-off-by: Andrew Lewycky
Signed-off-by: Daniel Koch
Author: Nicolas Capens
git-svn-id: https://angleproject.googlecode.com/svn/trunk@278 736b8ea6-26fd-11df-bfd4-992fa37f6226
diff --git a/src/compiler/preprocessor/cpp.c b/src/compiler/preprocessor/cpp.c
index 460df36..a8e22f3 100644
--- a/src/compiler/preprocessor/cpp.c
+++ b/src/compiler/preprocessor/cpp.c
@@ -84,6 +84,7 @@
static int __LINE__Atom = 0;
static int __FILE__Atom = 0;
static int __VERSION__Atom = 0;
+static int gl_esAtom = 0;
static int versionAtom = 0;
static int extensionAtom = 0;
@@ -118,6 +119,7 @@
__LINE__Atom = LookUpAddString(atable, "__LINE__");
__FILE__Atom = LookUpAddString(atable, "__FILE__");
__VERSION__Atom = LookUpAddString(atable, "__VERSION__");
+ gl_esAtom = LookUpAddString(atable, "GL_ES");
versionAtom = LookUpAddString(atable, "version");
extensionAtom = LookUpAddString(atable, "extension");
macros = NewScopeInPool(mem_CreatePool(0, 0));
@@ -900,6 +902,12 @@
UngetToken(CPP_INTCONSTANT, yylvalpp);
return 1;
}
+ if (atom == gl_esAtom) {
+ strcpy(yylvalpp->symbol_name,"1");
+ yylvalpp->sc_int = 1;
+ UngetToken(CPP_INTCONSTANT, yylvalpp);
+ return 1;
+ }
if (!sym || sym->details.mac.undef) return 0;
if (sym->details.mac.busy) return 0; // no recursive expansions
in = malloc(sizeof(*in));