1 --- OpenImageIO-oiio-bcdad81/src/field3d.imageio/CMakeLists.txt~ 2013-11-01 18:03:46.000000000 +0100
2 +++ OpenImageIO-oiio-bcdad81/src/field3d.imageio/CMakeLists.txt 2013-11-05 21:12:41.033996632 +0100
5 - if (FIELD3D_FOUND and HDF5_FOUND)
6 + if (FIELD3D_FOUND AND HDF5_FOUND)
7 include_directories (${FIELD3D_INCLUDES})
8 add_oiio_plugin (field3dinput.cpp field3doutput.cpp
9 LINK_LIBRARIES ${FIELD3D_LIBRARY}
11 From 77fd2276e12791dc17cb20526cd371d66140e416 Mon Sep 17 00:00:00 2001
12 From: Larry Gritz <lg@larrygritz.com>
13 Date: Tue, 5 Nov 2013 16:05:43 -0800
14 Subject: [PATCH] Make cleaner threads.h compile for the NOTHREADS case
17 src/include/thread.h | 27 ++++++++++++++++++++++-----
18 1 file changed, 22 insertions(+), 5 deletions(-)
20 diff --git a/src/include/thread.h b/src/include/thread.h
21 index e389ebb..ecf3e66 100644
22 --- a/src/include/thread.h
23 +++ b/src/include/thread.h
24 @@ -128,6 +128,7 @@ class null_mutex {
26 void lock_shared () { }
27 void unlock_shared () { }
28 + bool try_lock () { return true; }
31 /// Null lock that can be substituted for a real one to test how much
32 @@ -219,7 +220,9 @@ class thread_specific_ptr {
34 atomic_exchange_and_add (volatile int *at, int x)
36 -#ifdef USE_GCC_ATOMICS
38 + int r = *at; *at += x; return r;
39 +#elif defined(USE_GCC_ATOMICS)
40 return __sync_fetch_and_add ((int *)at, x);
42 atomic<int> *a = (atomic<int> *)at;
43 @@ -237,7 +240,9 @@ class thread_specific_ptr {
45 atomic_exchange_and_add (volatile long long *at, long long x)
47 -#ifdef USE_GCC_ATOMICS
49 + long long r = *at; *at += x; return r;
50 +#elif defined(USE_GCC_ATOMICS)
51 return __sync_fetch_and_add (at, x);
53 atomic<long long> *a = (atomic<long long> *)at;
54 @@ -261,11 +266,17 @@ class thread_specific_ptr {
55 /// *at = newval; return true;
61 atomic_compare_and_exchange (volatile int *at, int compareval, int newval)
63 -#ifdef USE_GCC_ATOMICS
65 + if (*at == compareval) {
66 + *at = newval; return true;
70 +#elif defined(USE_GCC_ATOMICS)
71 return __sync_bool_compare_and_swap (at, compareval, newval);
73 atomic<int> *a = (atomic<int> *)at;
74 @@ -282,7 +293,13 @@ class thread_specific_ptr {
76 atomic_compare_and_exchange (volatile long long *at, long long compareval, long long newval)
78 -#ifdef USE_GCC_ATOMICS
80 + if (*at == compareval) {
81 + *at = newval; return true;
85 +#elif defined(USE_GCC_ATOMICS)
86 return __sync_bool_compare_and_swap (at, compareval, newval);
88 atomic<long long> *a = (atomic<long long> *)at;