diff options
Diffstat (limited to 'ldmicro/miscutil.cpp')
-rw-r--r-- | ldmicro/miscutil.cpp | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/ldmicro/miscutil.cpp b/ldmicro/miscutil.cpp index 116d584..428e5f6 100644 --- a/ldmicro/miscutil.cpp +++ b/ldmicro/miscutil.cpp @@ -89,19 +89,16 @@ void Error(char *str, ...) va_start(f, str); vsprintf(buf, str, f); if(RunningInBatchMode) { - AttachConsoleDynamic(ATTACH_PARENT_PROCESS); - HANDLE h = GetStdHandle(STD_OUTPUT_HANDLE); - DWORD written; - + /* Only required for windows + * AttachConsoleDynamic(ATTACH_PARENT_PROCESS); + */ // Indicate that it's an error, plus the output filename - char str[MAX_PATH+100]; - sprintf(str, "compile error ('%s'): ", CurrentCompileFile); - WriteFile(h, str, strlen(str), &written, NULL); + printf("compile error ('%s'): ", CurrentCompileFile); // The error message itself - WriteFile(h, buf, strlen(buf), &written, NULL); + printf(buf); // And an extra newline to be safe. strcpy(str, "\n"); - WriteFile(h, str, strlen(str), &written, NULL); + printf(str); } else { HWND h = GetForegroundWindow(); MessageBox(h, buf, _("LDmicro Error"), MB_OK | MB_ICONERROR); |