mirror of
https://github.com/yuzu-emu/unicorn.git
synced 2025-01-22 23:01:02 +00:00
atomic: fix position of volatile qualifier
What needs to be volatile is not the pointer, but the pointed-to value! Backports commit 2cbcfb281afa041a41f6e4c4da0f5c9314084604 from qemu
This commit is contained in:
parent
e79e0881cd
commit
02e3eeff40
|
@ -138,11 +138,11 @@ void _ReadWriteBarrier(void);
|
|||
#endif
|
||||
|
||||
#ifndef atomic_read
|
||||
#define atomic_read(ptr) (*(__typeof__(*ptr) *volatile) (ptr))
|
||||
#define atomic_read(ptr) (*(__typeof__(*ptr) volatile*) (ptr))
|
||||
#endif
|
||||
|
||||
#ifndef atomic_set
|
||||
#define atomic_set(ptr, i) ((*(__typeof__(*ptr) *volatile) (ptr)) = (i))
|
||||
#define atomic_set(ptr, i) ((*(__typeof__(*ptr) volatile*) (ptr)) = (i))
|
||||
#endif
|
||||
|
||||
/* These have the same semantics as Java volatile variables.
|
||||
|
|
Loading…
Reference in a new issue