diff options
author | Ivan Maidanski <ivmai@mail.ru> | 2021-01-12 09:18:13 +0300 |
---|---|---|
committer | Ivan Maidanski <ivmai@mail.ru> | 2021-09-09 11:18:33 +0300 |
commit | c64527843da5f184e1e565d4ee464ce547ac1b03 (patch) | |
tree | de8e056327f66e8b7da5155115b29f37d506924e | |
parent | 52711cfca0c939e13da1d933ea8857e2c32edfcd (diff) | |
download | libatomic_ops-c64527843da5f184e1e565d4ee464ce547ac1b03.tar.gz |
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.
-rw-r--r-- | src/atomic_ops/sysdeps/all_aligned_atomic_load_store.h | 9 |
1 files changed, 8 insertions, 1 deletions
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 |