From 2273c0b0c1d10249ae364ddc355687e8dedf40f4 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Thu, 27 Jan 2011 15:31:00 -0800 Subject: [PATCH] Fixed compiling under Visual Studio --- src/timer/SDL_timer.c | 6 ++++++ src/timer/windows/SDL_systimer.c | 1 + test/testatomic.c | 1 - 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/timer/SDL_timer.c b/src/timer/SDL_timer.c index 593add64d..2ad2e4e23 100644 --- a/src/timer/SDL_timer.c +++ b/src/timer/SDL_timer.c @@ -224,7 +224,13 @@ SDL_TimerInit(void) } data->active = SDL_TRUE; + /* !!! FIXME: this is nasty. */ +#if (defined(__WIN32__) && !defined(_WIN32_WCE)) && !defined(HAVE_LIBC) +#undef SDL_CreateThread + data->thread = SDL_CreateThread(SDL_TimerThread, data, NULL, NULL); +#else data->thread = SDL_CreateThread(SDL_TimerThread, data); +#endif if (!data->thread) { SDL_TimerQuit(); return -1; diff --git a/src/timer/windows/SDL_systimer.c b/src/timer/windows/SDL_systimer.c index 2674e2200..6b3581c1b 100644 --- a/src/timer/windows/SDL_systimer.c +++ b/src/timer/windows/SDL_systimer.c @@ -24,6 +24,7 @@ #ifdef SDL_TIMER_WINDOWS #include "../../core/windows/SDL_windows.h" +#include #include "SDL_timer.h" diff --git a/test/testatomic.c b/test/testatomic.c index 98a6a7824..ecf134a2a 100644 --- a/test/testatomic.c +++ b/test/testatomic.c @@ -526,7 +526,6 @@ static int FIFO_Reader(void* _data) ReaderData *data = (ReaderData *)_data; SDL_EventQueue *queue = data->queue; SDL_Event event; - int index; if (data->lock_free) { for ( ; ; ) {