Fixed line numbers when a preprocessor directive fails.
--- a/mojoshader_preprocessor.c Sun Feb 15 01:53:08 2009 -0500
+++ b/mojoshader_preprocessor.c Sun Feb 15 02:03:24 2009 -0500
@@ -553,12 +553,12 @@
static int require_newline(IncludeState *state)
{
const char *source = state->source;
+ const unsigned int linenum = state->line;
const Token token = preprocessor_internal_lexer(state);
+ state->source = source; // rewind no matter what.
+ state->line = linenum;
if (token == TOKEN_INCOMPLETE_COMMENT)
- {
- state->source = source; // pick this up later.
- return 1; // call it an eol.
- } // if
+ return 1; // call it an eol.
return ( (token == ((Token) '\n')) || (token == TOKEN_EOI) );
} // require_newline