Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2016-05-02 10:55:08 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2016-05-02 10:55:08 +0300
commitc1ca667d4a9f42cda9dd7486f9826db07baacd2a (patch)
tree684af5e81e0bae1b2b59e1da0dfb7d255dd48d6a /intern/atomic
parent4e4ff72d13f4e0cae3ee75e944c1eb836285c009 (diff)
Fix compilation error on Armel architecture
__GCC_HAVE_SYNC_COMPARE_AND_SWAP_n are not defined on this architecture for some reason, however those functions are available. Adding a workaround for newly used __sync_fetch_and_and() function.
Diffstat (limited to 'intern/atomic')
-rw-r--r--intern/atomic/atomic_ops.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/intern/atomic/atomic_ops.h b/intern/atomic/atomic_ops.h
index dc06a51f859..06eb8f21da6 100644
--- a/intern/atomic/atomic_ops.h
+++ b/intern/atomic/atomic_ops.h
@@ -45,6 +45,7 @@
* arm7 architecture does have both 32 and 64bit atomics, however
* it's gcc doesn't have __GCC_HAVE_SYNC_COMPARE_AND_SWAP_n defined.
*/
+# define JE_FORCE_SYNC_COMPARE_AND_SWAP_1
# define JE_FORCE_SYNC_COMPARE_AND_SWAP_8
# define JE_FORCE_SYNC_COMPARE_AND_SWAP_4
#endif
@@ -399,6 +400,12 @@ atomic_fetch_and_and_uint8(uint8_t *p, uint8_t b)
return _InterlockedAnd8((char *)p, (char)b);
#endif
}
+#elif defined(JE_FORCE_SYNC_COMPARE_AND_SWAP_1)
+ATOMIC_INLINE uint8_t
+atomic_fetch_and_and_uint8(uint8_t *p, uint8_t b)
+{
+ return __sync_fetch_and_and(p, b);
+}
#else
# error "Missing implementation for 8-bit atomic operations"
#endif