From 0569acd5d6550788eca06e80e40432d13785c205 Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Sun, 2 Nov 2014 10:49:50 +0200 Subject: [PATCH] Fixed compilation issues with GCC 4.0.1 PowerPC --- src/cocoa/i_backend_cocoa.mm | 1 + src/cocoa/i_timer.cpp | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/cocoa/i_backend_cocoa.mm b/src/cocoa/i_backend_cocoa.mm index ffd95b5b3..d2c8b3093 100644 --- a/src/cocoa/i_backend_cocoa.mm +++ b/src/cocoa/i_backend_cocoa.mm @@ -41,6 +41,7 @@ #include #include +#include #include #include diff --git a/src/cocoa/i_timer.cpp b/src/cocoa/i_timer.cpp index db6811212..0699a9967 100644 --- a/src/cocoa/i_timer.cpp +++ b/src/cocoa/i_timer.cpp @@ -2,6 +2,7 @@ #include #include #include +#include #include @@ -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();