From a12357e7dc3cc428ef4d9b9f5f0139f4f5826bb1 Mon Sep 17 00:00:00 2001 From: icculus Date: Thu, 27 Mar 2008 17:10:27 -0400 Subject: [PATCH] [svn] Endline string wankery. --HG-- branch : trunk --- mojoshader.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/mojoshader.c b/mojoshader.c index 50c00bd6..961cb56b 100644 --- a/mojoshader.c +++ b/mojoshader.c @@ -56,6 +56,13 @@ typedef int32_t int32; #define STATICARRAYLEN(x) ( (sizeof ((x))) / (sizeof ((x)[0])) ) +#ifdef _WINDOWS // !!! FIXME: bleh +const char *endline_str = "\r\n"; +#else +const char *endline_str = "\n"; +#endif + + // Byteswap magic... @@ -2496,8 +2503,8 @@ static Context *build_context(const char *profile, ctx->free = f; ctx->tokens = (const uint32 *) tokenbuf; ctx->tokencount = bufsize / sizeof (uint32); - ctx->endline = "\n"; - ctx->endline_len = 1; // !!! FIXME: do "\r\n" on Windows? + ctx->endline = endline_str; + ctx->endline_len = strlen(ctx->endline); ctx->output.str = NULL; ctx->output.next = NULL; ctx->output_tail = &ctx->output;