Fixed compiling under Visual Studio
authorSam Lantinga <slouken@libsdl.org>
Thu, 27 Jan 2011 15:31:00 -0800
changeset 5114 e337f792c6a7
parent 5113 686d795b1b29
child 5115 427998ff3bcf
Fixed compiling under Visual Studio
src/timer/SDL_timer.c
src/timer/windows/SDL_systimer.c
test/testatomic.c
--- a/src/timer/SDL_timer.c	Thu Jan 27 15:58:30 2011 -0600
+++ b/src/timer/SDL_timer.c	Thu Jan 27 15:31:00 2011 -0800
@@ -224,7 +224,13 @@
         }
 
         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;
--- a/src/timer/windows/SDL_systimer.c	Thu Jan 27 15:58:30 2011 -0600
+++ b/src/timer/windows/SDL_systimer.c	Thu Jan 27 15:31:00 2011 -0800
@@ -24,6 +24,7 @@
 #ifdef SDL_TIMER_WINDOWS
 
 #include "../../core/windows/SDL_windows.h"
+#include <mmsystem.h>
 
 #include "SDL_timer.h"
 
--- a/test/testatomic.c	Thu Jan 27 15:58:30 2011 -0600
+++ b/test/testatomic.c	Thu Jan 27 15:31:00 2011 -0800
@@ -526,7 +526,6 @@
     ReaderData *data = (ReaderData *)_data;
     SDL_EventQueue *queue = data->queue;
     SDL_Event event;
-    int index;
 
     if (data->lock_free) {
         for ( ; ; ) {