Make the PP report an error on undefined macro in "#if ..." for ES profiles, unless relaxed error checking is requested.  Still works as normal CPP on non-ES.

Also, improved error reporting in general for the PP.


git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@21417 e7fa87d3-cd2b-0410-9028-fcbf551c1848
diff --git a/StandAlone/StandAlone.cpp b/StandAlone/StandAlone.cpp
index e66a315..cf58ed6 100644
--- a/StandAlone/StandAlone.cpp
+++ b/StandAlone/StandAlone.cpp
@@ -74,7 +74,7 @@
 ShBindingTable FixedAttributeTable = { 3, FixedAttributeBindings };
 
 static EShLanguage FindLanguage(char *lang);
-bool CompileFile(const char *fileName, ShHandle, int, const TBuiltInResource*);
+bool CompileFile(const char *fileName, ShHandle, int options, const TBuiltInResource*);
 void usage();
 void FreeFileData(char **data);
 char** ReadFileData(const char *fileName);
@@ -143,6 +143,9 @@
                 case 'l':
                     debugOptions |= EDebugOpMemoryLeakMode;
                     break;
+                case 'r':
+                    debugOptions |= EDebugOpRelaxedErrors;
+                    break;
                 case 's':
                     debugOptions |= EDebugOpSuppressInfolog;
                     break;
@@ -261,9 +264,12 @@
     if (!data)
         return false;
 
+    EShMessages messages = EShMsgDefault;
+    if (debugOptions & EDebugOpRelaxedErrors)
+        messages = (EShMessages)(messages | EShMsgRelaxedErrors);
     for (int i = 0; i < ((debugOptions & EDebugOpMemoryLeakMode) ? 100 : 1); ++i) {
         for (int j = 0; j < ((debugOptions & EDebugOpMemoryLeakMode) ? 100 : 1); ++j)
-            ret = ShCompile(compiler, data, OutputMultipleStrings, EShOptNone, resources, debugOptions, 100, false, EShMsgDefault);
+            ret = ShCompile(compiler, data, OutputMultipleStrings, EShOptNone, resources, debugOptions, 100, false, messages);
 
 #ifdef _WIN32
         if (debugOptions & EDebugOpMemoryLeakMode) {
@@ -290,7 +296,8 @@
            "-a: assembly dump (LLVM IR)\n"
            "-d: delay end (keeps output up in debugger, WIN32)\n"
            "-l: memory leak mode\n"
-           "-s: silent mode (no info log)\n");
+           "-s: silent mode (no info log)\n"
+           "-r: relaxed semantic error checking mode\n");
 }
 
 #ifndef _WIN32