qemu/include
Paolo Bonzini eb350d1d01 include: move typeof_strip_qual to compiler.h, use it in QAPI_LIST_LENGTH()
The typeof_strip_qual() is most useful for the atomic fetch-and-modify
operations in atomic.h, but it can be used elsewhere as well.  For example,
QAPI_LIST_LENGTH() assumes that the argument is not const, which is not a
requirement.

Move the macro to compiler.h and, while at it, move it under #ifndef
__cplusplus to emphasize that it uses C-only constructs.  A C++ version
of typeof_strip_qual() using type traits is possible[1], but beyond the
scope of this patch because the little C++ code that is in QEMU does not
use QAPI.

The patch was tested by changing the declaration of strv_from_str_list()
in qapi/qapi-type-helpers.c to:

    char **strv_from_str_list(const strList *const list)

This is valid C code, and it fails to compile without this change.

[1] https://lore.kernel.org/qemu-devel/20240624205647.112034-1-flwu@google.com/

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
Tested-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2024-06-28 14:44:52 +02:00
..
authz
block block: remove separate bdrv_file_open callback 2024-06-28 14:44:51 +02:00
chardev chardev: use bool for fe_is_open 2024-01-12 13:23:48 +00:00
crypto crypto/block: drop qcrypto_block_open() n_threads argument 2024-06-10 11:05:43 +02:00
disas disas: Use translator_st to get disassembly data 2024-05-15 08:55:19 +02:00
exec exec: don't use void* in pointer arithmetic in headers 2024-06-28 14:44:51 +02:00
fpu fpu: Add conversions between bfloat16 and [u]int8 2023-09-16 14:57:15 +00:00
gdbstub gdbstub: move enums into separate header 2024-06-24 10:14:17 +01:00
hw hw/riscv/virt.c: add address-cells in create_fdt_one_aplic() 2024-06-26 22:32:29 +10:00
io io: Introduce qio_channel_file_new_dupfd 2024-03-12 15:22:23 -04:00
libdecnumber
migration migration: Remove unused VMSTATE_ARRAY_TEST() macro 2024-06-21 14:37:58 -03:00
monitor monitor: Report errors from monitor_fdset_dup_fd_add 2024-06-21 09:47:21 -03:00
net net: Remove receive_raw() 2024-06-04 15:14:26 +08:00
qapi include: move typeof_strip_qual to compiler.h, use it in QAPI_LIST_LENGTH() 2024-06-28 14:44:52 +02:00
qemu include: move typeof_strip_qual to compiler.h, use it in QAPI_LIST_LENGTH() 2024-06-28 14:44:52 +02:00
qom include/qom/object.h: New OBJECT_DEFINE_SIMPLE_TYPE{, _WITH_INTERFACES} macros 2024-02-27 13:01:42 +00:00
scsi hw/ufs: Support for UFS logical unit 2023-09-07 14:01:29 -04:00
semihosting exec/cpu: Extract page-protection definitions to page-protection.h 2024-05-06 11:17:15 +02:00
standard-headers update-linux-headers: import linux/kvm_para.h header 2024-06-05 11:01:06 +02:00
sysemu vfio queue: 2024-06-24 21:30:34 -07:00
tcg tcg: Introduce TCG_TARGET_HAS_tst_vec 2024-05-22 19:05:21 -07:00
ui ui+display: rename is_buffer_shared() -> surface_is_allocated() 2024-06-19 12:42:03 +02:00
user user: Move 'thunk.h' from 'exec/user' to 'user' 2024-05-03 17:21:20 +02:00
elf.h util: spelling fixes 2023-08-31 19:47:43 +02:00
glib-compat.h Bump minimum glib version to v2.66 2024-05-14 12:46:24 +02:00
qemu-io.h
qemu-main.h