From e335821941dd19886263dcba31d3eafe2c915d54 Mon Sep 17 00:00:00 2001 From: Aras Pranckevicius Date: Thu, 25 Feb 2010 11:05:50 +0200 Subject: [PATCH] filename in #line is optional --- mojoshader_preprocessor.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/mojoshader_preprocessor.c b/mojoshader_preprocessor.c index 4507945c..368ea5a8 100644 --- a/mojoshader_preprocessor.c +++ b/mojoshader_preprocessor.c @@ -880,7 +880,15 @@ static void handle_pp_line(Context *ctx) 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) {