else if (tokens[2].compare("off") == 0)
contextPragma.optimize = false;
else {
- error(loc, "\"on\" or \"off\" expected after '(' for 'optimize' pragma", "#pragma", "");
+ if(relaxedErrors())
+ // If an implementation does not recognize the tokens following #pragma, then it will ignore that pragma.
+ warn(loc, "\"on\" or \"off\" expected after '(' for 'optimize' pragma", "#pragma", "");
return;
}
else if (tokens[2].compare("off") == 0)
contextPragma.debug = false;
else {
- error(loc, "\"on\" or \"off\" expected after '(' for 'debug' pragma", "#pragma", "");
+ if(relaxedErrors())
+ // If an implementation does not recognize the tokens following #pragma, then it will ignore that pragma.
+ warn(loc, "\"on\" or \"off\" expected after '(' for 'debug' pragma", "#pragma", "");
return;
}
if (strncmp(identifier, "GL_", 3) == 0)
ppError(loc, "names beginning with \"GL_\" can't be (un)defined:", op, identifier);
else if (strncmp(identifier, "defined", 8) == 0)
- ppError(loc, "\"defined\" can't be (un)defined:", op, identifier);
+ if (relaxedErrors())
+ ppWarn(loc, "\"defined\" is (un)defined:", op, identifier);
+ else
+ ppError(loc, "\"defined\" can't be (un)defined:", op, identifier);
else if (strstr(identifier, "__") != 0) {
if (isEsProfile() && version >= 300 &&
(strcmp(identifier, "__LINE__") == 0 ||
strcmp(identifier, "__VERSION__") == 0))
ppError(loc, "predefined names can't be (un)defined:", op, identifier);
else {
- if (isEsProfile() && version < 300)
+ if (isEsProfile() && version < 300 && !relaxedErrors())
ppError(loc, "names containing consecutive underscores are reserved, and an error if version < 300:", op, identifier);
else
ppWarn(loc, "names containing consecutive underscores are reserved:", op, identifier);
#define GL_UNSIGNED_INT64_VEC2_ARB 0x8FE5
#define GL_UNSIGNED_INT64_VEC3_ARB 0x8FE6
#define GL_UNSIGNED_INT64_VEC4_ARB 0x8FE7
+#define GL_UNSIGNED_INT16_VEC2_NV 0x8FF1
+#define GL_UNSIGNED_INT16_VEC3_NV 0x8FF2
+#define GL_UNSIGNED_INT16_VEC4_NV 0x8FF3
+
+#define GL_INT16_NV 0x8FE4
+#define GL_INT16_VEC2_NV 0x8FE5
+#define GL_INT16_VEC3_NV 0x8FE6
+#define GL_INT16_VEC4_NV 0x8FE7
#define GL_BOOL 0x8B56
#define GL_BOOL_VEC2 0x8B57
if (! parseContext.isReadingHLSL() && isMacroInput()) {
if (parseContext.relaxedErrors())
parseContext.ppWarn(ppToken->loc, "nonportable when expanded from macros for preprocessor expression",
- "defined", "");
+ "defined", "");
else
parseContext.ppError(ppToken->loc, "cannot use in preprocessor expression when expanded from macros",
- "defined", "");
+ "defined", "");
}
bool needclose = 0;
token = scanToken(ppToken);
int macroAtom = atomStrings.getAtom(ppToken->name);
switch (macroAtom) {
case PpAtomLineMacro:
- ppToken->ival = parseContext.getCurrentLoc().line;
+ // Arguments which are macro have been replaced in the first stage.
+ if (ppToken->ival == 0)
+ ppToken->ival = parseContext.getCurrentLoc().line;
snprintf(ppToken->name, sizeof(ppToken->name), "%d", ppToken->ival);
UngetToken(PpAtomConstInt, ppToken);
return MacroExpandStarted;
nestStack.push_back('}');
else if (nestStack.size() > 0 && token == nestStack.back())
nestStack.pop_back();
+
+ //Macro replacement list is expanded in the last stage.
+ if (atomStrings.getAtom(ppToken->name) == PpAtomLineMacro)
+ ppToken->ival = parseContext.getCurrentLoc().line;
+
in->args[arg]->putToken(token, ppToken);
tokenRecorded = true;
}