Skip to content

Commit

Permalink
Merge pull request #6 from H-M-H/mac_fix
Browse files Browse the repository at this point in the history
Fix compiling on mac. Thanks H-M-H :)
  • Loading branch information
andreasgangso committed Apr 14, 2016
2 parents 8afced2 + 3b9df06 commit 7aa086d
Show file tree
Hide file tree
Showing 25 changed files with 17 additions and 2,934 deletions.
Binary file removed datasrc/__pycache__/content.cpython-32.pyc
Binary file not shown.
Binary file removed datasrc/__pycache__/content.cpython-33.pyc
Binary file not shown.
Binary file removed datasrc/__pycache__/content.cpython-34.pyc
Binary file not shown.
Binary file removed datasrc/__pycache__/content.cpython-35.pyc
Binary file not shown.
Binary file removed datasrc/__pycache__/datatypes.cpython-32.pyc
Binary file not shown.
Binary file removed datasrc/__pycache__/datatypes.cpython-33.pyc
Binary file not shown.
Binary file removed datasrc/__pycache__/datatypes.cpython-34.pyc
Binary file not shown.
Binary file removed datasrc/__pycache__/datatypes.cpython-35.pyc
Binary file not shown.
Binary file removed datasrc/__pycache__/network.cpython-32.pyc
Binary file not shown.
Binary file removed datasrc/__pycache__/network.cpython-33.pyc
Binary file not shown.
Binary file removed datasrc/__pycache__/network.cpython-34.pyc
Binary file not shown.
Binary file removed datasrc/__pycache__/network.cpython-35.pyc
Binary file not shown.
6 changes: 3 additions & 3 deletions src/base/system.c
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ int io_flush(IOHANDLE io)
return 0;
}

void *thread_create(void (*threadfunc)(void *), void *u)
void *thread_init(void (*threadfunc)(void *), void *u)
{
#if defined(CONF_FAMILY_UNIX)
pthread_t id;
Expand Down Expand Up @@ -474,7 +474,7 @@ void lock_destroy(LOCK lock)
mem_free(lock);
}

int lock_try(LOCK lock)
int lock_trylock(LOCK lock)
{
#if defined(CONF_FAMILY_UNIX)
return pthread_mutex_trylock((LOCKINTERNAL *)lock);
Expand All @@ -496,7 +496,7 @@ void lock_wait(LOCK lock)
#endif
}

void lock_release(LOCK lock)
void lock_unlock(LOCK lock)
{
#if defined(CONF_FAMILY_UNIX)
pthread_mutex_unlock((LOCKINTERNAL *)lock);
Expand Down
8 changes: 4 additions & 4 deletions src/base/system.h
Original file line number Diff line number Diff line change
Expand Up @@ -352,15 +352,15 @@ IOHANDLE io_stderr();
void thread_sleep(int milliseconds);

/*
Function: thread_create
Function: thread_init
Creates a new thread.
Parameters:
threadfunc - Entry point for the new thread.
user - Pointer to pass to the thread.
*/
void *thread_create(void (*threadfunc)(void *), void *user);
void *thread_init(void (*threadfunc)(void *), void *user);

/*
Function: thread_wait
Expand Down Expand Up @@ -403,9 +403,9 @@ typedef void* LOCK;
LOCK lock_create();
void lock_destroy(LOCK lock);

int lock_try(LOCK lock);
int lock_trylock(LOCK lock);
void lock_wait(LOCK lock);
void lock_release(LOCK lock);
void lock_unlock(LOCK lock);


/* Group: Semaphores */
Expand Down
2 changes: 1 addition & 1 deletion src/base/tl/threading.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ class lock
LOCK var;

void take() { lock_wait(var); }
void release() { lock_release(var); }
void release() { lock_unlock(var); }

public:
lock()
Expand Down
2 changes: 1 addition & 1 deletion src/engine/client/backend_sdl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ void CGraphicsBackend_Threaded::StartProcessor(ICommandProcessor *pProcessor)
{
m_Shutdown = false;
m_pProcessor = pProcessor;
m_pThread = thread_create(ThreadFunc, this);
m_pThread = thread_init(ThreadFunc, this);
m_BufferDone.signal();
}

Expand Down
10 changes: 5 additions & 5 deletions src/engine/client/sound.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ static void Mix(short *pFinalOut, unsigned Frames)


// release the lock
lock_release(m_SoundLock);
lock_unlock(m_SoundLock);

{
// clamp accumulated values
Expand Down Expand Up @@ -259,7 +259,7 @@ int CSound::Update()
{
lock_wait(m_SoundLock);
m_SoundVolume = WantedVolume;
lock_release(m_SoundLock);
lock_unlock(m_SoundLock);
}

return 0;
Expand Down Expand Up @@ -476,7 +476,7 @@ int CSound::Play(int ChannelID, int SampleID, int Flags, float x, float y)
m_aVoices[VoiceID].m_Y = (int)y;
}

lock_release(m_SoundLock);
lock_unlock(m_SoundLock);
return VoiceID;
}

Expand Down Expand Up @@ -506,7 +506,7 @@ void CSound::Stop(int SampleID)
m_aVoices[i].m_pSample = 0;
}
}
lock_release(m_SoundLock);
lock_unlock(m_SoundLock);
}

void CSound::StopAll()
Expand All @@ -524,7 +524,7 @@ void CSound::StopAll()
}
m_aVoices[i].m_pSample = 0;
}
lock_release(m_SoundLock);
lock_unlock(m_SoundLock);
}

IOHANDLE CSound::ms_File = 0;
Expand Down
6 changes: 3 additions & 3 deletions src/engine/shared/jobs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ void CJobPool::WorkerThread(void *pUser)
else
pPool->m_pLastJob = 0;
}
lock_release(pPool->m_Lock);
lock_unlock(pPool->m_Lock);

// do the job if we have one
if(pJob)
Expand All @@ -49,7 +49,7 @@ int CJobPool::Init(int NumThreads)
{
// start threads
for(int i = 0; i < NumThreads; i++)
thread_create(WorkerThread, this);
thread_init(WorkerThread, this);
return 0;
}

Expand All @@ -69,7 +69,7 @@ int CJobPool::Add(CJob *pJob, JOBFUNC pfnFunc, void *pData)
if(!m_pFirstJob)
m_pFirstJob = pJob;

lock_release(m_Lock);
lock_unlock(m_Lock);
return 0;
}

Loading

0 comments on commit 7aa086d

Please sign in to comment.