diff --git a/src/oplsynth/music_opl_mididevice.cpp b/src/oplsynth/music_opl_mididevice.cpp index 3939aa814..3cd3e625a 100644 --- a/src/oplsynth/music_opl_mididevice.cpp +++ b/src/oplsynth/music_opl_mididevice.cpp @@ -41,13 +41,14 @@ #include "m_swap.h" #include "w_wad.h" #include "v_text.h" +#include "i_system.h" #include "opl.h" // MACROS ------------------------------------------------------------------ #if defined(_DEBUG) && defined(_WIN32) && defined(_MSC_VER) #define DEBUGOUT(m,c,s,t) \ - { char foo[128]; mysnprintf(foo, countof(foo), m, c, s, t); OutputDebugString(foo); } + { char foo[128]; mysnprintf(foo, countof(foo), m, c, s, t); I_DebugPrint(foo); } #else #define DEBUGOUT(m,c,s,t) #endif diff --git a/src/posix/cocoa/i_system.mm b/src/posix/cocoa/i_system.mm index 07e85281b..6224228ad 100644 --- a/src/posix/cocoa/i_system.mm +++ b/src/posix/cocoa/i_system.mm @@ -183,6 +183,12 @@ void I_SetIWADInfo() } +void I_DebugPrint(const char *cp) +{ + NSLog(@"%s", cp); +} + + void I_PrintStr(const char* const message) { FConsoleWindow::GetInstance().AddText(message); diff --git a/src/posix/i_system.h b/src/posix/i_system.h index 0515f2d85..5051b19c1 100644 --- a/src/posix/i_system.h +++ b/src/posix/i_system.h @@ -111,6 +111,8 @@ void addterm (void (*func)(void), const char *name); #define atterm(t) addterm (t, #t) void popterm (); +void I_DebugPrint (const char *cp); + // Print a console string void I_PrintStr (const char *str); diff --git a/src/posix/sdl/i_system.cpp b/src/posix/sdl/i_system.cpp index 84b953717..5cf5bf280 100644 --- a/src/posix/sdl/i_system.cpp +++ b/src/posix/sdl/i_system.cpp @@ -232,6 +232,10 @@ void I_SetIWADInfo () { } +void I_DebugPrint(const char *cp) +{ +} + void I_PrintStr (const char *cp) { // Strip out any color escape sequences before writing to the log file diff --git a/src/sound/music_softsynth_mididevice.cpp b/src/sound/music_softsynth_mididevice.cpp index 9897da95c..6bde3edf6 100644 --- a/src/sound/music_softsynth_mididevice.cpp +++ b/src/sound/music_softsynth_mididevice.cpp @@ -40,6 +40,7 @@ #include "m_swap.h" #include "w_wad.h" #include "v_text.h" +#include "i_system.h" // MACROS ------------------------------------------------------------------ @@ -337,7 +338,7 @@ int SoftSynthMIDIDevice::PlayTick() char buffer[128]; mysnprintf(buffer, countof(buffer), "C%02d: %11s %3d %3d\n", (status & 15) + 1, commands[(status >> 4) & 7], parm1, parm2); #ifdef _WIN32 - OutputDebugString(buffer); + I_DebugPrint(buffer); #else fputs(buffer, stderr); #endif diff --git a/src/timidity/timidity.cpp b/src/timidity/timidity.cpp index efebcd284..4ca2b872e 100644 --- a/src/timidity/timidity.cpp +++ b/src/timidity/timidity.cpp @@ -782,11 +782,6 @@ void Renderer::MarkInstrument(int banknum, int percussion, int instr) } } -#ifdef _WIN32 -#define WIN32_LEAN_AND_MEAN -#include -#endif - void cmsg(int type, int verbosity_level, const char *fmt, ...) { /* @@ -801,7 +796,7 @@ void cmsg(int type, int verbosity_level, const char *fmt, ...) va_start(args, fmt); vsprintf(buf, fmt, args); va_end(args); - OutputDebugString(buf); + I_DebugPrint(buf); #endif } diff --git a/src/win32/i_system.cpp b/src/win32/i_system.cpp index ebf90e476..98eaf669c 100644 --- a/src/win32/i_system.cpp +++ b/src/win32/i_system.cpp @@ -1051,6 +1051,11 @@ static void DoPrintStr(const char *cp, HWND edit, HANDLE StdOut) static TArray bufferedConsoleStuff; +void I_DebugPrint(const char *cp) +{ + OutputDebugStringA(cp); +} + void I_PrintStr(const char *cp) { if (con_debugoutput) diff --git a/src/win32/i_system.h b/src/win32/i_system.h index 8e75b22a3..6bee888f2 100644 --- a/src/win32/i_system.h +++ b/src/win32/i_system.h @@ -145,6 +145,8 @@ bool I_SetCursor(FTexture *cursor); // Repaint the pre-game console void I_PaintConsole (void); +void I_DebugPrint (const char *cp); + // Print a console string void I_PrintStr (const char *cp);