[svn] Endline string wankery. trunk
authoricculus
Thu, 27 Mar 2008 17:10:27 -0400
branchtrunk
changeset 45 9565678766aa
parent 44 5d56cf8b4571
child 46 ff5a0ec44f00
[svn] Endline string wankery.
mojoshader.c
--- a/mojoshader.c	Thu Mar 27 17:02:49 2008 -0400
+++ b/mojoshader.c	Thu Mar 27 17:10:27 2008 -0400
@@ -56,6 +56,13 @@
 
 #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 @@
     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;