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
parent edff8dc8
......@@ -84,6 +84,7 @@ static int errorAtom = 0;
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 @@ int InitCPP(void)
__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 @@ int MacroExpand(int atom, yystypepp * yylvalpp)
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));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment