-//\r
-// Log handler\r
-//\r
-// by James L. Hammons\r
-// (C) 2006 Underground Software\r
-//\r
-// JLH = James L. Hammons <jlhamm@acm.org>\r
-//\r
-// WHO WHEN WHAT\r
-// --- ---------- ------------------------------------------------------------\r
-// JLH 01/03/2006 Moved includes out of header file for faster compilation\r
-//\r
-\r
-#include "log.h"\r
-\r
-#include <stdio.h>\r
-#include <stdlib.h>\r
-#include <stdarg.h>\r
-#include "types.h"\r
-\r
-#define MAX_LOG_SIZE 10000000 // Maximum size of log file (10 MB)\r
-\r
-static FILE * log_stream = NULL;\r
-static uint32 logSize = 0;\r
-\r
-bool InitLog(char * path)\r
-{\r
- log_stream = fopen(path, "wrt");\r
-\r
- if (log_stream == NULL)\r
- return false;\r
-\r
- return true;\r
-}\r
-\r
-void LogDone(void)\r
-{\r
- if (log_stream)\r
- fclose(log_stream);\r
-}\r
-\r
-//\r
-// This logger is used mainly to ensure that text gets written to the log file\r
-// even if the program crashes. The performance hit is acceptable in this case!\r
-//\r
-void WriteLog(const char * text, ...)\r
-{\r
- if (!log_stream)\r
- return;\r
-\r
- va_list arg;\r
-\r
- va_start(arg, text);\r
- logSize += vfprintf(log_stream, text, arg);\r
-\r
- if (logSize > MAX_LOG_SIZE)\r
- {\r
- fflush(log_stream);\r
- fclose(log_stream);\r
- exit(1);\r
- }//*/\r
-\r
- va_end(arg);\r
- fflush(log_stream); // Make sure that text is written!\r
-}\r
+//
+// Log handler
+//
+// by James L. Hammons
+// (C) 2006 Underground Software
+//
+// JLH = James L. Hammons <jlhamm@acm.org>
+//
+// WHO WHEN WHAT
+// --- ---------- ------------------------------------------------------------
+// JLH 01/03/2006 Moved includes out of header file for faster compilation
+//
+
+#include "log.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <stdarg.h>
+#include "types.h"
+
+#define MAX_LOG_SIZE 10000000 // Maximum size of log file (10 MB)
+
+static FILE * log_stream = NULL;
+static uint32 logSize = 0;
+
+bool InitLog(char * path)
+{
+ log_stream = fopen(path, "wrt");
+
+ if (log_stream == NULL)
+ return false;
+
+ return true;
+}
+
+void LogDone(void)
+{
+ if (log_stream)
+ fclose(log_stream);
+}
+
+//
+// This logger is used mainly to ensure that text gets written to the log file
+// even if the program crashes. The performance hit is acceptable in this case!
+//
+void WriteLog(const char * text, ...)
+{
+ if (!log_stream)
+ return;
+
+ va_list arg;
+
+ va_start(arg, text);
+ logSize += vfprintf(log_stream, text, arg);
+
+ if (logSize > MAX_LOG_SIZE)
+ {
+ fflush(log_stream);
+ fclose(log_stream);
+ exit(1);
+ }//*/
+
+ va_end(arg);
+ fflush(log_stream); // Make sure that text is written!
+}