Add ASSERTs to all calls of nameModule
[ghc-hetmet.git] / rts / RtsMessages.c
index 53a910e..c263a2c 100644 (file)
@@ -10,6 +10,8 @@
 #include "Rts.h"
 
 #include <stdio.h>
+#include <string.h>
+#include <errno.h>
 
 #ifdef HAVE_WINDOWS_H
 #include <windows.h>
@@ -237,7 +239,12 @@ rtsSysErrorMsgFn(const char *s, va_list ap)
        }
        vfprintf(stderr, s, ap);
        if (syserr) {
+#if defined(cygwin32_HOST_OS) || defined (mingw32_HOST_OS)
+            // Win32 error messages have a terminating \n
+           fprintf(stderr, ": %s", syserr);
+#else
            fprintf(stderr, ": %s\n", syserr);
+#endif
        } else {
            fprintf(stderr, "\n");
        }