Implicitly define GL_ES

TRAC #12257 Signed-off-by: Andrew Lewycky Signed-off-by: Daniel Koch Author: Nicolas Capens git-svn-id: https://angleproject.googlecode.com/svn/trunk@284 736b8ea6-26fd-11df-bfd4-992fa37f6226
parent c808c5a9
......@@ -98,6 +98,12 @@ int InitCPP(void)
{
char buffer[64], *t;
const char *f;
SourceLoc location = {0};
Symbol *symbol;
MacroSymbol macro = {0};
yystypepp one = {0};
// Add various atoms needed by the CPP line scanner:
bindAtom = LookUpAddString(atable, "bind");
constAtom = LookUpAddString(atable, "const");
......@@ -129,6 +135,15 @@ int InitCPP(void)
while ((isalnum(*f) || *f == '_') && t < buffer + sizeof(buffer) - 1)
*t++ = toupper(*f++);
*t = 0;
// #define GL_ES 1
macro.body = NewTokenStream("GL_ES", macros->pool);
one.sc_int = 1;
strcpy(one.symbol_name, "1");
RecordToken(macro.body, CPP_INTCONSTANT, &one);
symbol = AddSymbol(&location, macros, gl_esAtom, MACRO_S);
symbol->details.mac = macro;
return 1;
} // InitCPP
......@@ -902,12 +917,6 @@ 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