From 7a6c661976c71eef111d77adf90730cd92ced570 Mon Sep 17 00:00:00 2001 From: Richard M. Shaw Date: Apr 25 2012 16:21:04 +0000 Subject: Add patch for ppc64 build. --- diff --git a/OpenImageIO-1.0.3-ppc64.patch b/OpenImageIO-1.0.3-ppc64.patch new file mode 100644 index 0000000..7f92d5a --- /dev/null +++ b/OpenImageIO-1.0.3-ppc64.patch @@ -0,0 +1,49 @@ + src/include/thread.h | 14 ++++++++++++++ + 1 files changed, 14 insertions(+), 0 deletions(-) + +diff --git a/src/include/thread.h b/src/include/thread.h +index 3b3bd19..53773e8 100644 +--- a/src/include/thread.h ++++ b/src/include/thread.h +@@ -272,6 +272,11 @@ atomic_exchange_and_add (volatile int *at, int x) + #elif defined(_WIN32) + // Windows + return _InterlockedExchangeAdd ((volatile LONG *)at, x); ++#elif defined (__PPC__) ++ long long r; ++ r = *at; ++ *at += x; ++ return r; + #else + # error No atomics on this platform. + #endif +@@ -297,6 +302,11 @@ atomic_exchange_and_add (volatile long long *at, long long x) + # else + return InterlockedExchangeAdd64 ((volatile LONGLONG *)at, x); + # endif ++#elif defined (__PPC__) ++ long long r; ++ r = *at; ++ *at += x; ++ return r; + #else + # error No atomics on this platform. + #endif +@@ -322,6 +332,8 @@ atomic_compare_and_exchange (volatile int *at, int compareval, int newval) + return OSAtomicCompareAndSwap32Barrier (compareval, newval, at); + #elif defined(_WIN32) + return (_InterlockedCompareExchange ((volatile LONG *)at, newval, compareval) == compareval); ++#elif defined(__PPC__) ++ return ((*at == compareval) ? (*at = newval), 1 : 0); + #else + # error No atomics on this platform. + #endif +@@ -341,6 +353,8 @@ atomic_compare_and_exchange (volatile long long *at, long long compareval, long + return OSAtomicCompareAndSwap64Barrier (compareval, newval, at); + #elif defined(_WIN32) + return (_InterlockedCompareExchange64 ((volatile LONGLONG *)at, newval, compareval) == compareval); ++#elif defined(__PPC__) ++ return ((*at == compareval) ? (*at = newval), 1 : 0); + #else + # error No atomics on this platform. + #endif