unicorn/qemu/include
Stefan Hajnoczi 320b59ddb9 qemu/atomic.h: rename atomic_ to qatomic_
clang's C11 atomic_fetch_*() functions only take a C11 atomic type
pointer argument. QEMU uses direct types (int, etc) and this causes a
compiler error when a QEMU code calls these functions in a source file
that also included <stdatomic.h> via a system header file:

$ CC=clang CXX=clang++ ./configure ... && make
../util/async.c:79:17: error: address argument to atomic operation must be a pointer to _Atomic type ('unsigned int *' invalid)

Avoid using atomic_*() names in QEMU's atomic.h since that namespace is
used by <stdatomic.h>. Prefix QEMU's APIs with 'q' so that atomic.h
and <stdatomic.h> can co-exist. I checked /usr/include on my machine and
searched GitHub for existing "qatomic_" users but there seem to be none.

This patch was generated using:

$ git grep -h -o '\<atomic\(64\)\?_[a-z0-9_]\+' include/qemu/atomic.h | \
sort -u >/tmp/changed_identifiers
$ for identifier in $(</tmp/changed_identifiers); do
sed -i "s%\<$identifier\>%q$identifier%g" \
$(git grep -I -l "\<$identifier\>")
done

I manually fixed line-wrap issues and misaligned rST tables.

Backports d73415a315471ac0b127ed3fad45c8ec5d711de1
2021-03-08 14:34:35 -05:00
..
crypto Drop unused crypto source files 2018-02-17 15:23:57 -05:00
exec qemu/atomic.h: rename atomic_ to qatomic_ 2021-03-08 14:34:35 -05:00
fpu softfloat: Define comparison operations for bfloat16 2021-02-27 16:43:10 -05:00
hw target/arm: Set instance_align on CPUARM TypeInfo 2021-03-01 18:58:44 -05:00
qapi qapi: Rewrite string-input-visitor's integer and list parsing 2018-12-18 04:57:25 -05:00
qemu qemu/atomic.h: rename atomic_ to qatomic_ 2021-03-08 14:34:35 -05:00
qom qemu/atomic.h: rename atomic_ to qatomic_ 2021-03-08 14:34:35 -05:00
sysemu accel: Remove unused AccelClass::available field 2019-05-03 11:31:27 -04:00
config.h import 2015-08-21 15:04:50 +08:00
elf.h include/elf: Update elf.h to commit f71a8eaffba3271cf7cdad95572f6996f7523a5b 2018-03-11 15:34:35 -04:00
glib_compat.h tcg: Introduce TYPE_CONST temporaries 2021-03-03 21:29:40 -05:00
qemu-common.h tcg: Add EXCP_ATOMIC 2018-02-27 11:57:58 -05:00