Add ppc patch.

This commit is contained in:
Richard M. Shaw 2012-06-12 14:03:59 -05:00
parent 69334180ef
commit 011445b9a7
2 changed files with 47 additions and 0 deletions

45
OpenImageIO-ppc.patch Normal file
View File

@ -0,0 +1,45 @@
diff -up OpenImageIO-oiio-1fa4a20/src/include/thread.h.ppckh OpenImageIO-oiio-1fa4a20/src/include/thread.h
--- OpenImageIO-oiio-1fa4a20/src/include/thread.h.ppckh 2012-04-25 15:29:32.530321567 +0200
+++ OpenImageIO-oiio-1fa4a20/src/include/thread.h 2012-04-25 15:29:42.490320642 +0200
@@ -267,6 +267,11 @@ atomic_exchange_and_add (volatile int *a
#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
@@ -292,6 +297,11 @@ atomic_exchange_and_add (volatile long l
# 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
@@ -317,6 +327,8 @@ atomic_compare_and_exchange (volatile in
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
@@ -336,6 +348,8 @@ atomic_compare_and_exchange (volatile lo
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

View File

@ -15,6 +15,7 @@ Source1: FindTBB.cmake
Patch0: OpenImageIO-1.0.0-use_external_tbb.patch
Patch1: OpenImageIO-1.0.0-tbb_include.patch
Patch2: OpenImageIO-ppc.patch
BuildRequires: cmake
BuildRequires: qt4-devel
@ -63,6 +64,7 @@ Development files for package %{name}
%setup -q -n %{name}-oiio-%{githash2}
%patch0 -p1 -b .exttbb
%patch1 -p1 -b .tbbinc
%patch2 -p1 -b .ppc
# Remove bundled pugixml
rm -f src/include/pugixml.hpp \