From 44b8bb47712424278d4993c7190c10366ba25ec0 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Thu, 12 Feb 2009 02:55:45 -0500 Subject: [PATCH] Fixed preprocessor indent and endline output. --- mojoshader_preprocessor.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mojoshader_preprocessor.c b/mojoshader_preprocessor.c index a976dc7c..457e6a9f 100644 --- a/mojoshader_preprocessor.c +++ b/mojoshader_preprocessor.c @@ -659,7 +659,7 @@ include_close = (MOJOSHADER_includeClose) 0x1; // tokens. For example, after a semicolon. This allows HLSL code to // be mostly readable, instead of a stream of tokens. if (token == ((Token) '\n')) - ; // ignore. + isnewline = nl; // this doesn't actually care about '\n' ... else if ( (token == ((Token) '}')) || (token == ((Token) ';')) ) { @@ -683,6 +683,7 @@ include_close = (MOJOSHADER_includeClose) 0x1; { out_of_memory = (!add_to_buffer(&buffer,endline,sizeof (endline),m,d)) || + (!indent_buffer(&buffer, indent, 1, m, d)) || (!add_to_buffer(&buffer, "{", 1, m, d)) || (!add_to_buffer(&buffer,endline,sizeof (endline),m,d)); indent++;