Fixed compilation issues with GCC 4.0.1 PowerPC

This commit is contained in:
alexey.lysiuk 2014-11-02 10:49:50 +02:00
parent d1c4215fb5
commit 0569acd5d6
2 changed files with 8 additions and 1 deletions

View file

@ -41,6 +41,7 @@
#include <AppKit/AppKit.h>
#include <Carbon/Carbon.h>
#include <OpenGL/OpenGL.h>
#include <OpenGL/gl.h>
#include <SDL.h>

View file

@ -2,6 +2,7 @@
#include <assert.h>
#include <sys/time.h>
#include <pthread.h>
#include <libkern/OSAtomic.h>
#include <SDL.h>
@ -92,7 +93,12 @@ void* TimerThreadFunc(void*)
if (!g_isTicFrozen)
{
__sync_add_and_fetch(&s_tics, 1);
// The following GCC/Clang intrinsic can be used instead of OS X specific function:
// __sync_add_and_fetch(&s_tics, 1);
// Although it's not supported on all platform/compiler combination,
// e.g. GCC 4.0.1 with PowerPC target architecture
OSAtomicIncrement32(&s_tics);
}
s_timerStart = SDL_GetTicks();