+++ /dev/null
-From: Roland Stigge <stigge@antcom.de>
-Date: Tue, 21 May 2013 15:09:00 +0200
-Subject: Fix_FTBFS_on_atomic_operations
-
----
- src/include/thread.h | 8 ++++----
- 1 file changed, 4 insertions(+), 4 deletions(-)
-
-diff --git a/src/include/thread.h b/src/include/thread.h
-index e389ebb..4735796 100644
---- a/src/include/thread.h
-+++ b/src/include/thread.h
-@@ -220,7 +220,7 @@ inline int
- atomic_exchange_and_add (volatile int *at, int x)
- {
- #ifdef USE_GCC_ATOMICS
-- return __sync_fetch_and_add ((int *)at, x);
-+ return __atomic_fetch_add ((int *)at, x, __ATOMIC_SEQ_CST);
- #elif USE_TBB
- atomic<int> *a = (atomic<int> *)at;
- return a->fetch_and_add (x);
-@@ -238,7 +238,7 @@ inline long long
- atomic_exchange_and_add (volatile long long *at, long long x)
- {
- #ifdef USE_GCC_ATOMICS
-- return __sync_fetch_and_add (at, x);
-+ return __atomic_fetch_add (at, x, __ATOMIC_SEQ_CST);
- #elif USE_TBB
- atomic<long long> *a = (atomic<long long> *)at;
- return a->fetch_and_add (x);
-@@ -266,7 +266,7 @@ inline bool
- atomic_compare_and_exchange (volatile int *at, int compareval, int newval)
- {
- #ifdef USE_GCC_ATOMICS
-- return __sync_bool_compare_and_swap (at, compareval, newval);
-+ return __atomic_compare_exchange_n (at, &compareval, newval, false, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST);
- #elif USE_TBB
- atomic<int> *a = (atomic<int> *)at;
- return a->compare_and_swap (newval, compareval) == newval;
-@@ -283,7 +283,7 @@ inline bool
- atomic_compare_and_exchange (volatile long long *at, long long compareval, long long newval)
- {
- #ifdef USE_GCC_ATOMICS
-- return __sync_bool_compare_and_swap (at, compareval, newval);
-+ return __atomic_compare_exchange_n (at, &compareval, newval, false, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST);
- #elif USE_TBB
- atomic<long long> *a = (atomic<long long> *)at;
- return a->compare_and_swap (newval, compareval) == newval;
include_directories (${FIELD3D_INCLUDES})
add_oiio_plugin (field3dinput.cpp field3doutput.cpp
LINK_LIBRARIES ${FIELD3D_LIBRARY}
---- OpenImageIO-oiio-bcdad81/src/include/thread.h~ 2013-11-01 18:03:46.000000000 +0100
-+++ OpenImageIO-oiio-bcdad81/src/include/thread.h 2013-11-06 06:22:43.859550166 +0100
-@@ -128,6 +128,7 @@
+
+From 77fd2276e12791dc17cb20526cd371d66140e416 Mon Sep 17 00:00:00 2001
+From: Larry Gritz <lg@larrygritz.com>
+Date: Tue, 5 Nov 2013 16:05:43 -0800
+Subject: [PATCH] Make cleaner threads.h compile for the NOTHREADS case
+
+---
+ src/include/thread.h | 27 ++++++++++++++++++++++-----
+ 1 file changed, 22 insertions(+), 5 deletions(-)
+
+diff --git a/src/include/thread.h b/src/include/thread.h
+index e389ebb..ecf3e66 100644
+--- a/src/include/thread.h
++++ b/src/include/thread.h
+@@ -128,6 +128,7 @@ class null_mutex {
void unlock () { }
void lock_shared () { }
void unlock_shared () { }
};
/// Null lock that can be substituted for a real one to test how much
+@@ -219,7 +220,9 @@ class thread_specific_ptr {
+ inline int
+ atomic_exchange_and_add (volatile int *at, int x)
+ {
+-#ifdef USE_GCC_ATOMICS
++#ifdef NOTHREADS
++ int r = *at; *at += x; return r;
++#elif defined(USE_GCC_ATOMICS)
+ return __sync_fetch_and_add ((int *)at, x);
+ #elif USE_TBB
+ atomic<int> *a = (atomic<int> *)at;
+@@ -237,7 +240,9 @@ class thread_specific_ptr {
+ inline long long
+ atomic_exchange_and_add (volatile long long *at, long long x)
+ {
+-#ifdef USE_GCC_ATOMICS
++#ifdef NOTHREADS
++ long long r = *at; *at += x; return r;
++#elif defined(USE_GCC_ATOMICS)
+ return __sync_fetch_and_add (at, x);
+ #elif USE_TBB
+ atomic<long long> *a = (atomic<long long> *)at;
+@@ -261,11 +266,17 @@ class thread_specific_ptr {
+ /// *at = newval; return true;
+ /// } else {
+ /// return false;
+-///
++/// }
+ inline bool
+ atomic_compare_and_exchange (volatile int *at, int compareval, int newval)
+ {
+-#ifdef USE_GCC_ATOMICS
++#ifdef NOTHREADS
++ if (*at == compareval) {
++ *at = newval; return true;
++ } else {
++ return false;
++ }
++#elif defined(USE_GCC_ATOMICS)
+ return __sync_bool_compare_and_swap (at, compareval, newval);
+ #elif USE_TBB
+ atomic<int> *a = (atomic<int> *)at;
+@@ -282,7 +293,13 @@ class thread_specific_ptr {
+ inline bool
+ atomic_compare_and_exchange (volatile long long *at, long long compareval, long long newval)
+ {
+-#ifdef USE_GCC_ATOMICS
++#ifdef NOTHREADS
++ if (*at == compareval) {
++ *at = newval; return true;
++ } else {
++ return false;
++ }
++#elif defined(USE_GCC_ATOMICS)
+ return __sync_bool_compare_and_swap (at, compareval, newval);
+ #elif USE_TBB
+ atomic<long long> *a = (atomic<long long> *)at;
+--
+1.8.4
+
Patch7: %{name}-werror.patch
Patch8: 0002-Fix_IlmBase_issue.patch
Patch9: 0003-Fix_multiarch_paths.patch
-Patch10: 0004-Fix_FTBFS_on_atomic_operations.patch
URL: https://sites.google.com/site/openimageio/home
BuildRequires: Field3D-devel
%{?with_ocio:BuildRequires: OpenColorIO-devel}
%patch7 -p1
%patch8 -p1
%patch9 -p1
-%patch10 -p1
%{__rm} -r src/dds.imageio/squish src/ptex.imageio/ptex
# when using system pugixml, don't use hacked headers