Skip to content

Commit cdefab4

Browse files
guiltSiegeLord
authored andcommitted
Enable debug window for DEBUGMODE on Windows (XP and Higher).
1 parent 15e3702 commit cdefab4

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/debug.c

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -174,12 +174,14 @@ static void open_trace_file(void)
174174
if (s)
175175
trace_info.trace_file = fopen(s, "w");
176176
else
177-
#ifdef ALLEGRO_IPHONE
177+
#if defined(ALLEGRO_IPHONE)
178178
// Remember, we have no (accessible) filesystem on (not jailbroken)
179179
// iphone.
180180
// stderr will be redirected to xcode's debug console though, so
181181
// it's as good to use as the NSLog stuff.
182182
trace_info.trace_file = stderr;
183+
#elif defined(ALLEGRO_WINDOWS)
184+
trace_info.trace_file = NULL;
183185
#else
184186
trace_info.trace_file = fopen("allegro.log", "w");
185187
#endif
@@ -193,7 +195,7 @@ static void do_trace(const char *msg, ...)
193195
{
194196
va_list ap;
195197

196-
#ifdef ALLEGRO_ANDROID
198+
#if defined(ALLEGRO_ANDROID) || defined(ALLEGRO_WINDOWS)
197199
if (true)
198200
#else
199201
if (_al_user_trace_handler)
@@ -305,7 +307,7 @@ void _al_trace_suffix(const char *msg, ...)
305307
int olderr = errno;
306308
va_list ap;
307309

308-
#ifdef ALLEGRO_ANDROID
310+
#if defined(ALLEGRO_ANDROID) || defined(ALLEGRO_WINDOWS)
309311
if (true)
310312
#else
311313
if (_al_user_trace_handler)
@@ -326,6 +328,9 @@ void _al_trace_suffix(const char *msg, ...)
326328
static_trace_buffer);
327329
}
328330
#endif
331+
#ifdef ALLEGRO_WINDOWS
332+
(void) OutputDebugString((LPCTSTR) static_trace_buffer);
333+
#endif
329334
static_trace_buffer[0] = '\0';
330335
}
331336
else if (trace_info.trace_file) {

0 commit comments

Comments
 (0)