Detect and report multiple #version directives
TRAC #12072
Signed-off-by: Shannon Woods
Signed-off-by: Daniel Koch
Author: Nicolas Capens
git-svn-id: https://angleproject.googlecode.com/svn/trunk@206 736b8ea6-26fd-11df-bfd4-992fa37f6226
diff --git a/src/compiler/preprocessor/cpp.c b/src/compiler/preprocessor/cpp.c
index 92e8443..beb895a 100644
--- a/src/compiler/preprocessor/cpp.c
+++ b/src/compiler/preprocessor/cpp.c
@@ -638,7 +638,7 @@
int token = cpp->currentInput->scan(cpp->currentInput, yylvalpp);
- if (cpp->notAVersionToken == 1)
+ if (cpp->pastFirstStatement == 1)
CPPShInfoLogMsg("#version must occur before any other statement in the program");
if(token=='\n'){
@@ -734,7 +734,7 @@
}else{
CPPErrorToInfoLog("#else after a #else");
cpp->ifdepth=0;
- cpp->notAVersionToken = 1;
+ cpp->pastFirstStatement = 1;
return 0;
}
} else if (yylvalpp->sc_ident == elifAtom) {
@@ -787,7 +787,7 @@
token = cpp->currentInput->scan(cpp->currentInput, yylvalpp);
}
- cpp->notAVersionToken = !isVersion;
+ cpp->pastFirstStatement = 1;
return token;
} // readCPPline