[OpenImageIO/el6] Add patch for ppc64 build.

Richard Shaw hobbes1069 at fedoraproject.org
Wed Apr 25 16:21:13 UTC 2012


commit 7a6c661976c71eef111d77adf90730cd92ced570
Author: Richard M. Shaw <hobbes1069 at gmail.com>
Date:   Wed Apr 25 11:21:04 2012 -0500

    Add patch for ppc64 build.

 OpenImageIO-1.0.3-ppc64.patch |   49 +++++++++++++++++++++++++++++++++++++++++
 1 files changed, 49 insertions(+), 0 deletions(-)
---
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


More information about the scm-commits mailing list