filename in #line is optional
authorAras Pranckevicius <aras@unity3d.com>
Thu, 25 Feb 2010 11:05:50 +0200
changeset 871 e72ec737ed74
parent 870 f9e20269c20b
child 872 5fde53b06a2e
filename in #line is optional
mojoshader_preprocessor.c
--- a/mojoshader_preprocessor.c	Thu Feb 25 08:52:46 2010 +0200
+++ b/mojoshader_preprocessor.c	Thu Feb 25 11:05:50 2010 +0200
@@ -880,7 +880,15 @@
         linenum = token_to_int(state);
 
     if (!bogus)
-        bogus = (lexer(state) != TOKEN_STRING_LITERAL);
+    {
+        Token t = lexer(state);
+        if (t == ((Token) '\n'))
+        {
+            state->line = linenum;
+            return;
+        }
+        bogus = (t != TOKEN_STRING_LITERAL);
+    }
 
     if (!bogus)
     {