mojoshader_preprocessor.c
changeset 1122 b333c15bb984
parent 1121 4142681f9fda
child 1126 91c22d2de774
--- a/mojoshader_preprocessor.c	Thu Feb 14 00:46:12 2013 -0500
+++ b/mojoshader_preprocessor.c	Fri Feb 15 15:01:50 2013 -0500
@@ -546,10 +546,6 @@
         } // if
     } // if
 
-    #if !MATCH_MICROSOFT_PREPROCESSOR
-    state->report_comments = 1;
-    #endif
-
     state->close_callback = close_callback;
     state->source_base = source;
     state->source = source;
@@ -732,10 +728,6 @@
 
 static Token lexer(IncludeState *state)
 {
-    #if !MATCH_MICROSOFT_PREPROCESSOR
-    state->report_whitespace = 1;
-    #endif
-
     if (!state->pushedback)
         return preprocessor_lexer(state);
     state->pushedback = 0;
@@ -2022,8 +2014,18 @@
         const Conditional *cond = state->conditional_stack;
         const int skipping = ((cond != NULL) && (cond->skipping));
 
+        #if !MATCH_MICROSOFT_PREPROCESSOR
+        state->report_whitespace = 1;
+        state->report_comments = 1;
+        #endif
+
         const Token token = lexer(state);
 
+        #if !MATCH_MICROSOFT_PREPROCESSOR
+        state->report_whitespace = 0;
+        state->report_comments = 0;
+        #endif
+
         if (token != TOKEN_IDENTIFIER)
             ctx->recursion_count = 0;