WinRT: made the skeleton C++11 thread implementation use .cpp files, not .c

--HG--
rename : src/thread/stdcpp/SDL_syscond.c => src/thread/stdcpp/SDL_syscond.cpp
rename : src/thread/stdcpp/SDL_sysmutex.c => src/thread/stdcpp/SDL_sysmutex.cpp
rename : src/thread/stdcpp/SDL_systhread.c => src/thread/stdcpp/SDL_systhread.cpp
This commit is contained in:
David Ludwig 2012-11-22 23:12:06 -05:00
parent e4c6ec5708
commit 7a24dc071b
4 changed files with 20 additions and 3 deletions

View file

@ -91,9 +91,9 @@
<ClCompile Include="..\..\src\stdlib\SDL_string.c" /> <ClCompile Include="..\..\src\stdlib\SDL_string.c" />
<ClCompile Include="..\..\src\thread\generic\SDL_syssem.c" /> <ClCompile Include="..\..\src\thread\generic\SDL_syssem.c" />
<ClCompile Include="..\..\src\thread\SDL_thread.c" /> <ClCompile Include="..\..\src\thread\SDL_thread.c" />
<ClCompile Include="..\..\src\thread\stdcpp\SDL_syscond.c" /> <ClCompile Include="..\..\src\thread\stdcpp\SDL_syscond.cpp" />
<ClCompile Include="..\..\src\thread\stdcpp\SDL_sysmutex.c" /> <ClCompile Include="..\..\src\thread\stdcpp\SDL_sysmutex.cpp" />
<ClCompile Include="..\..\src\thread\stdcpp\SDL_systhread.c" /> <ClCompile Include="..\..\src\thread\stdcpp\SDL_systhread.cpp" />
<ClCompile Include="..\..\src\timer\dummy\SDL_systimer.c" /> <ClCompile Include="..\..\src\timer\dummy\SDL_systimer.c" />
<ClCompile Include="..\..\src\timer\SDL_timer.c" /> <ClCompile Include="..\..\src\timer\SDL_timer.c" />
<ClCompile Include="..\..\src\video\dummy\SDL_nullevents.c" /> <ClCompile Include="..\..\src\video\dummy\SDL_nullevents.c" />

View file

@ -38,6 +38,7 @@ struct SDL_cond
}; };
/* Create a condition variable */ /* Create a condition variable */
extern "C"
SDL_cond * SDL_cond *
SDL_CreateCond(void) SDL_CreateCond(void)
{ {
@ -60,6 +61,7 @@ SDL_CreateCond(void)
} }
/* Destroy a condition variable */ /* Destroy a condition variable */
extern "C"
void void
SDL_DestroyCond(SDL_cond * cond) SDL_DestroyCond(SDL_cond * cond)
{ {
@ -78,6 +80,7 @@ SDL_DestroyCond(SDL_cond * cond)
} }
/* Restart one of the threads that are waiting on the condition variable */ /* Restart one of the threads that are waiting on the condition variable */
extern "C"
int int
SDL_CondSignal(SDL_cond * cond) SDL_CondSignal(SDL_cond * cond)
{ {
@ -103,6 +106,7 @@ SDL_CondSignal(SDL_cond * cond)
} }
/* Restart all threads that are waiting on the condition variable */ /* Restart all threads that are waiting on the condition variable */
extern "C"
int int
SDL_CondBroadcast(SDL_cond * cond) SDL_CondBroadcast(SDL_cond * cond)
{ {
@ -158,6 +162,7 @@ Thread B:
SDL_CondSignal(cond); SDL_CondSignal(cond);
SDL_UnlockMutex(lock); SDL_UnlockMutex(lock);
*/ */
extern "C"
int int
SDL_CondWaitTimeout(SDL_cond * cond, SDL_mutex * mutex, Uint32 ms) SDL_CondWaitTimeout(SDL_cond * cond, SDL_mutex * mutex, Uint32 ms)
{ {
@ -214,6 +219,7 @@ SDL_CondWaitTimeout(SDL_cond * cond, SDL_mutex * mutex, Uint32 ms)
} }
/* Wait on the condition variable forever */ /* Wait on the condition variable forever */
extern "C"
int int
SDL_CondWait(SDL_cond * cond, SDL_mutex * mutex) SDL_CondWait(SDL_cond * cond, SDL_mutex * mutex)
{ {

View file

@ -34,6 +34,7 @@ struct SDL_mutex
}; };
/* Create a mutex */ /* Create a mutex */
extern "C"
SDL_mutex * SDL_mutex *
SDL_CreateMutex(void) SDL_CreateMutex(void)
{ {
@ -57,6 +58,7 @@ SDL_CreateMutex(void)
} }
/* Free the mutex */ /* Free the mutex */
extern "C"
void void
SDL_DestroyMutex(SDL_mutex * mutex) SDL_DestroyMutex(SDL_mutex * mutex)
{ {
@ -69,6 +71,7 @@ SDL_DestroyMutex(SDL_mutex * mutex)
} }
/* Lock the semaphore */ /* Lock the semaphore */
extern "C"
int int
SDL_mutexP(SDL_mutex * mutex) SDL_mutexP(SDL_mutex * mutex)
{ {
@ -100,6 +103,7 @@ SDL_mutexP(SDL_mutex * mutex)
} }
/* Unlock the mutex */ /* Unlock the mutex */
extern "C"
int int
SDL_mutexV(SDL_mutex * mutex) SDL_mutexV(SDL_mutex * mutex)
{ {

View file

@ -22,9 +22,12 @@
/* Thread management routines for SDL */ /* Thread management routines for SDL */
extern "C" {
#include "SDL_thread.h" #include "SDL_thread.h"
#include "../SDL_systhread.h" #include "../SDL_systhread.h"
}
extern "C"
int int
SDL_SYS_CreateThread(SDL_Thread * thread, void *args) SDL_SYS_CreateThread(SDL_Thread * thread, void *args)
{ {
@ -32,24 +35,28 @@ SDL_SYS_CreateThread(SDL_Thread * thread, void *args)
return (-1); return (-1);
} }
extern "C"
void void
SDL_SYS_SetupThread(const char *name) SDL_SYS_SetupThread(const char *name)
{ {
return; return;
} }
extern "C"
SDL_threadID SDL_threadID
SDL_ThreadID(void) SDL_ThreadID(void)
{ {
return (0); return (0);
} }
extern "C"
int int
SDL_SYS_SetThreadPriority(SDL_ThreadPriority priority) SDL_SYS_SetThreadPriority(SDL_ThreadPriority priority)
{ {
return (0); return (0);
} }
extern "C"
void void
SDL_SYS_WaitThread(SDL_Thread * thread) SDL_SYS_WaitThread(SDL_Thread * thread)
{ {