update PPC patch, use power64 macro

This commit is contained in:
Karsten Hopp 2013-01-28 14:34:02 +01:00
parent cdf8b4c6ed
commit 7709c72122
2 changed files with 21 additions and 18 deletions

View File

@ -1,7 +1,7 @@
diff -Naur OpenImageIO-oiio-2939154.orig/src/include/thread.h OpenImageIO-oiio-2939154/src/include/thread.h
--- OpenImageIO-oiio-2939154.orig/src/include/thread.h 2012-06-04 12:30:16.000000000 -0500
+++ OpenImageIO-oiio-2939154/src/include/thread.h 2012-06-13 15:14:36.648990016 -0500
@@ -103,7 +103,7 @@
diff -up oiio-Release-1.1.3/src/include/thread.h.ppc oiio-Release-1.1.3/src/include/thread.h
--- oiio-Release-1.1.3/src/include/thread.h.ppc 2013-01-10 02:13:37.000000000 +0100
+++ oiio-Release-1.1.3/src/include/thread.h 2013-01-28 14:30:48.667934337 +0100
@@ -98,7 +98,7 @@
#endif
#if defined(__GNUC__) && (defined(_GLIBCXX_ATOMIC_BUILTINS) || (__GNUC__ * 100 + __GNUC_MINOR__ >= 401))
@ -10,19 +10,19 @@ diff -Naur OpenImageIO-oiio-2939154.orig/src/include/thread.h OpenImageIO-oiio-2
#define USE_GCC_ATOMICS
#endif
#endif
@@ -272,6 +272,11 @@
#elif defined(_WIN32)
@@ -224,6 +224,11 @@ atomic_exchange_and_add (volatile int *a
#elif defined(_MSC_VER)
// Windows
return _InterlockedExchangeAdd ((volatile LONG *)at, x);
+#elif defined (__PPC__)
+ long long r;
+ r = *at;
+ *at += x;
+ return r;
+ long long r;
+ r = *at;
+ *at += x;
+ return r;
#else
# error No atomics on this platform.
#endif
@@ -297,6 +302,11 @@
@@ -249,6 +254,11 @@ atomic_exchange_and_add (volatile long l
# else
return InterlockedExchangeAdd64 ((volatile LONGLONG *)at, x);
# endif
@ -34,18 +34,18 @@ diff -Naur OpenImageIO-oiio-2939154.orig/src/include/thread.h OpenImageIO-oiio-2
#else
# error No atomics on this platform.
#endif
@@ -322,6 +332,8 @@
@@ -274,6 +284,8 @@ atomic_compare_and_exchange (volatile in
return OSAtomicCompareAndSwap32Barrier (compareval, newval, at);
#elif defined(_WIN32)
#elif defined(_MSC_VER)
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 @@
@@ -293,6 +305,8 @@ atomic_compare_and_exchange (volatile lo
return OSAtomicCompareAndSwap64Barrier (compareval, newval, at);
#elif defined(_WIN32)
#elif defined(_MSC_VER)
return (_InterlockedCompareExchange64 ((volatile LONGLONG *)at, newval, compareval) == compareval);
+#elif defined(__PPC__)
+ return ((*at == compareval) ? (*at = newval), 1 : 0);

View File

@ -4,7 +4,7 @@
Name: OpenImageIO
Version: 1.1.3
Release: 2%{?dist}
Release: 3%{?dist}
Summary: Library for reading and writing images
Group: Development/Libraries
@ -88,7 +88,7 @@ Development files for package %{name}
#setup -q -n %{name}-oiio-%{githash2}
%setup -q -n oiio-Release-%{version}
%patch0 -p1 -b .exttbb
%ifarch ppc ppc64
%ifarch ppc %{power64}
%patch2 -p1 -b .ppc
%endif
%patch3 -p1 -b .sha1
@ -125,7 +125,7 @@ rm -rf build/linux && mkdir -p build/linux && pushd build/linux
%else
-DUSE_TBB:BOOL=FALSE \
%endif
%ifarch ppc ppc64
%ifarch ppc %{power64}
-DNOTHREADS:BOOL=TRUE \
%endif
../../src
@ -172,6 +172,9 @@ cp -a doc/*.1 %{buildroot}%{_mandir}/man1
%changelog
* Mon Jan 28 2013 Karsten Hopp <karsten@redhat.com> 1.1.3-3
- update PPC patch, use power64 macro
* Fri Jan 18 2013 Adam Tkac <atkac redhat com> - 1.1.3-2
- rebuild due to "jpeg8-ABI" feature drop