Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
WinRT: made the skeleton C++11 thread implementation use .cpp files, …
Browse files Browse the repository at this point in the history
…not .c
  • Loading branch information
DavidLudwig committed Nov 23, 2012
1 parent fe6e90d commit 18a8df3
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 3 deletions.
6 changes: 3 additions & 3 deletions VisualC/SDL/SDL_VS2012_WinRT.vcxproj
Expand Up @@ -91,9 +91,9 @@
<ClCompile Include="..\..\src\stdlib\SDL_string.c" />
<ClCompile Include="..\..\src\thread\generic\SDL_syssem.c" />
<ClCompile Include="..\..\src\thread\SDL_thread.c" />
<ClCompile Include="..\..\src\thread\stdcpp\SDL_syscond.c" />
<ClCompile Include="..\..\src\thread\stdcpp\SDL_sysmutex.c" />
<ClCompile Include="..\..\src\thread\stdcpp\SDL_systhread.c" />
<ClCompile Include="..\..\src\thread\stdcpp\SDL_syscond.cpp" />
<ClCompile Include="..\..\src\thread\stdcpp\SDL_sysmutex.cpp" />
<ClCompile Include="..\..\src\thread\stdcpp\SDL_systhread.cpp" />
<ClCompile Include="..\..\src\timer\dummy\SDL_systimer.c" />
<ClCompile Include="..\..\src\timer\SDL_timer.c" />
<ClCompile Include="..\..\src\video\dummy\SDL_nullevents.c" />
Expand Down
Expand Up @@ -38,6 +38,7 @@ struct SDL_cond
};

/* Create a condition variable */
extern "C"
SDL_cond *
SDL_CreateCond(void)
{
Expand All @@ -60,6 +61,7 @@ SDL_CreateCond(void)
}

/* Destroy a condition variable */
extern "C"
void
SDL_DestroyCond(SDL_cond * cond)
{
Expand All @@ -78,6 +80,7 @@ SDL_DestroyCond(SDL_cond * cond)
}

/* Restart one of the threads that are waiting on the condition variable */
extern "C"
int
SDL_CondSignal(SDL_cond * cond)
{
Expand All @@ -103,6 +106,7 @@ SDL_CondSignal(SDL_cond * cond)
}

/* Restart all threads that are waiting on the condition variable */
extern "C"
int
SDL_CondBroadcast(SDL_cond * cond)
{
Expand Down Expand Up @@ -158,6 +162,7 @@ Thread B:
SDL_CondSignal(cond);
SDL_UnlockMutex(lock);
*/
extern "C"
int
SDL_CondWaitTimeout(SDL_cond * cond, SDL_mutex * mutex, Uint32 ms)
{
Expand Down Expand Up @@ -214,6 +219,7 @@ SDL_CondWaitTimeout(SDL_cond * cond, SDL_mutex * mutex, Uint32 ms)
}

/* Wait on the condition variable forever */
extern "C"
int
SDL_CondWait(SDL_cond * cond, SDL_mutex * mutex)
{
Expand Down
Expand Up @@ -34,6 +34,7 @@ struct SDL_mutex
};

/* Create a mutex */
extern "C"
SDL_mutex *
SDL_CreateMutex(void)
{
Expand All @@ -57,6 +58,7 @@ SDL_CreateMutex(void)
}

/* Free the mutex */
extern "C"
void
SDL_DestroyMutex(SDL_mutex * mutex)
{
Expand All @@ -69,6 +71,7 @@ SDL_DestroyMutex(SDL_mutex * mutex)
}

/* Lock the semaphore */
extern "C"
int
SDL_mutexP(SDL_mutex * mutex)
{
Expand Down Expand Up @@ -100,6 +103,7 @@ SDL_mutexP(SDL_mutex * mutex)
}

/* Unlock the mutex */
extern "C"
int
SDL_mutexV(SDL_mutex * mutex)
{
Expand Down
Expand Up @@ -22,34 +22,41 @@

/* Thread management routines for SDL */

extern "C" {
#include "SDL_thread.h"
#include "../SDL_systhread.h"
}

extern "C"
int
SDL_SYS_CreateThread(SDL_Thread * thread, void *args)
{
SDL_SetError("Threads are not supported on this platform");
return (-1);
}

extern "C"
void
SDL_SYS_SetupThread(const char *name)
{
return;
}

extern "C"
SDL_threadID
SDL_ThreadID(void)
{
return (0);
}

extern "C"
int
SDL_SYS_SetThreadPriority(SDL_ThreadPriority priority)
{
return (0);
}

extern "C"
void
SDL_SYS_WaitThread(SDL_Thread * thread)
{
Expand Down

0 comments on commit 18a8df3

Please sign in to comment.