Compare commits
19 Commits
Author | SHA1 | Date |
---|---|---|
Richard M. Shaw | 445f69a935 | |
Richard M. Shaw | 753582fd6a | |
Richard M. Shaw | 3040001735 | |
Richard M. Shaw | 5907817269 | |
Richard M. Shaw | 5aad988794 | |
Richard M. Shaw | cfc0cdb83f | |
Richard M. Shaw | 133ed4f241 | |
Richard M. Shaw | 026866e861 | |
Richard M. Shaw | 6a27bccdf8 | |
Richard M. Shaw | 47d07a5c21 | |
Richard M. Shaw | 8bfa9a347c | |
Richard M. Shaw | 6e554ccd1a | |
Richard M. Shaw | 4143dbced2 | |
Richard M. Shaw | 4d6b4b9518 | |
Richard M. Shaw | a746e34c3f | |
Richard M. Shaw | 57952262a0 | |
Richard M. Shaw | b51484b566 | |
Richard M. Shaw | 7a6c661976 | |
Richard M. Shaw | 2752d175a5 |
|
@ -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
|
|
@ -94,7 +94,6 @@ Development files for package %{name}
|
||||||
%setup -q -n oiio-Release-%{version}
|
%setup -q -n oiio-Release-%{version}
|
||||||
%patch0 -p1 -b .arm
|
%patch0 -p1 -b .arm
|
||||||
%patch1 -p1 -b .ppc
|
%patch1 -p1 -b .ppc
|
||||||
#patch2 -p1 -b .s390
|
|
||||||
%patch3 -p1 -b .cmake
|
%patch3 -p1 -b .cmake
|
||||||
%patch4 -p1 -b .spin_mutex
|
%patch4 -p1 -b .spin_mutex
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,7 @@ diff -Naur oiio-Release-1.2.1.orig/src/include/thread.h oiio-Release-1.2.1/src/i
|
||||||
#elif defined(_MSC_VER)
|
#elif defined(_MSC_VER)
|
||||||
// Windows
|
// Windows
|
||||||
return _InterlockedExchangeAdd ((volatile LONG *)at, x);
|
return _InterlockedExchangeAdd ((volatile LONG *)at, x);
|
||||||
+#elif defined (__powerpc__)
|
+#elif defined (__powerpc__) || defined(__PPC__)
|
||||||
+ long long r;
|
+ long long r;
|
||||||
+ r = *at;
|
+ r = *at;
|
||||||
+ *at += x;
|
+ *at += x;
|
||||||
|
@ -28,7 +28,7 @@ diff -Naur oiio-Release-1.2.1.orig/src/include/thread.h oiio-Release-1.2.1/src/i
|
||||||
# else
|
# else
|
||||||
return InterlockedExchangeAdd64 ((volatile LONGLONG *)at, x);
|
return InterlockedExchangeAdd64 ((volatile LONGLONG *)at, x);
|
||||||
# endif
|
# endif
|
||||||
+#elif defined (__powerpc__)
|
+#elif defined (__powerpc__) || defined(__PPC__)
|
||||||
+ long long r;
|
+ long long r;
|
||||||
+ r = *at;
|
+ r = *at;
|
||||||
+ *at += x;
|
+ *at += x;
|
||||||
|
@ -40,7 +40,7 @@ diff -Naur oiio-Release-1.2.1.orig/src/include/thread.h oiio-Release-1.2.1/src/i
|
||||||
return a->compare_and_swap (newval, compareval) == newval;
|
return a->compare_and_swap (newval, compareval) == newval;
|
||||||
#elif defined(_MSC_VER)
|
#elif defined(_MSC_VER)
|
||||||
return (_InterlockedCompareExchange ((volatile LONG *)at, newval, compareval) == compareval);
|
return (_InterlockedCompareExchange ((volatile LONG *)at, newval, compareval) == compareval);
|
||||||
+#elif defined(__powerpc__)
|
+#elif defined(__powerpc__) || defined(__PPC__)
|
||||||
+ return ((*at == compareval) ? (*at = newval), 1 : 0);
|
+ return ((*at == compareval) ? (*at = newval), 1 : 0);
|
||||||
#else
|
#else
|
||||||
# error No atomics on this platform.
|
# error No atomics on this platform.
|
||||||
|
@ -49,8 +49,19 @@ diff -Naur oiio-Release-1.2.1.orig/src/include/thread.h oiio-Release-1.2.1/src/i
|
||||||
return a->compare_and_swap (newval, compareval) == newval;
|
return a->compare_and_swap (newval, compareval) == newval;
|
||||||
#elif defined(_MSC_VER)
|
#elif defined(_MSC_VER)
|
||||||
return (_InterlockedCompareExchange64 ((volatile LONGLONG *)at, newval, compareval) == compareval);
|
return (_InterlockedCompareExchange64 ((volatile LONGLONG *)at, newval, compareval) == compareval);
|
||||||
+#elif defined(__PPC__)
|
+#elif defined(__PPC__) || defined(__powerpc__)
|
||||||
+ return ((*at == compareval) ? (*at = newval), 1 : 0);
|
+ return ((*at == compareval) ? (*at = newval), 1 : 0);
|
||||||
#else
|
#else
|
||||||
# error No atomics on this platform.
|
# error No atomics on this platform.
|
||||||
#endif
|
#endif
|
||||||
|
diff -Naur oiio-Release-1.2.1.orig/src/bmp.imageio/bmp_pvt.h oiio-Release-1.2.1/src/bmp.imageio/bmp_pvt.h
|
||||||
|
--- oiio-Release-1.2.1.orig/src/bmp.imageio/bmp_pvt.h 2013-08-06 00:10:31.000000000 -0500
|
||||||
|
+++ oiio-Release-1.2.1/src/bmp.imageio/bmp_pvt.h 2013-10-01 16:10:19.546711936 -0500
|
||||||
|
@@ -34,6 +34,7 @@
|
||||||
|
#include "imageio.h"
|
||||||
|
#include "filesystem.h"
|
||||||
|
#include "fmath.h"
|
||||||
|
+#include "thread.h"
|
||||||
|
|
||||||
|
OIIO_PLUGIN_NAMESPACE_BEGIN
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue