Skip to content

Commit

Permalink
Fixed the windows message debug output so it works without HAVE_LIBC
Browse files Browse the repository at this point in the history
  • Loading branch information
slouken committed Oct 14, 2013
1 parent e7e86c6 commit fea2699
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions src/video/windows/SDL_windowsevents.c
Expand Up @@ -309,18 +309,16 @@ WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
}

#ifdef WMMSG_DEBUG
{
FILE *log = fopen("wmmsg.txt", "a");
fprintf(log, "Received windows message: %p ", hwnd);
if (msg > MAX_WMMSG) {
fprintf(log, "%d", msg);
} else {
fprintf(log, "%s", wmtab[msg]);
}
fprintf(log, " -- 0x%X, 0x%X\n", wParam, lParam);
fclose(log);
}
#endif
{
char message[1024];
if (msg > MAX_WMMSG) {
SDL_snprintf(message, sizeof(message), "Received windows message: %p UNKNOWN (%d) -- 0x%X, 0x%X\n", hwnd, msg, wParam, lParam);
} else {
SDL_snprintf(message, sizeof(message), "Received windows message: %p %s -- 0x%X, 0x%X\n", hwnd, wmtab[msg], wParam, lParam);
}
OutputDebugStringA(message);
}
#endif /* WMMSG_DEBUG */

if (IME_HandleMessage(hwnd, msg, wParam, &lParam, data->videodata))
return 0;
Expand Down

0 comments on commit fea2699

Please sign in to comment.