From ddd04c4d79317f1d2aa8917d6e5f4d17b237bdea Mon Sep 17 00:00:00 2001 From: Ivan Maidanski Date: Tue, 12 Jan 2021 09:18:13 +0300 Subject: Workaround assertion violation in AO_load/store on m68k Issue #48 (libatomic_ops). * src/atomic_ops/sysdeps/all_aligned_atomic_load_store.h (AO_ACCESS_CHECK_ALIGNED): Do not define if __m68k__; add comment. --- src/atomic_ops/sysdeps/all_aligned_atomic_load_store.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/atomic_ops/sysdeps/all_aligned_atomic_load_store.h b/src/atomic_ops/sysdeps/all_aligned_atomic_load_store.h index 6d81279..97f31e1 100644 --- a/src/atomic_ops/sysdeps/all_aligned_atomic_load_store.h +++ b/src/atomic_ops/sysdeps/all_aligned_atomic_load_store.h @@ -24,7 +24,14 @@ /* short, and unsigned int loads and stores are atomic but only if data */ /* is suitably aligned. */ -#define AO_ACCESS_CHECK_ALIGNED +#if defined(__m68k__) + /* Even though AO_t is redefined in m68k.h, some clients use AO */ + /* pointer size primitives to access variables not declared as AO_t. */ + /* Such variables may have 2-byte alignment, while their sizeof is 4. */ +#else +# define AO_ACCESS_CHECK_ALIGNED +#endif + /* Check for char type is a misnomer. */ #define AO_ACCESS_short_CHECK_ALIGNED #define AO_ACCESS_int_CHECK_ALIGNED -- cgit v1.2.1