On 6/14/21 4:14 AM, Paolo Bonzini wrote:
On 12/06/21 01:33, Richard Henderson wrote:
- unknown_lock_type))
+/* Auxiliary macros to simplify QEMU_MAKE_LOCABLE. */
+#define QEMU_LOCK_FUNC(x) ((QemuLockUnlockFunc *) \
+ _Generic((x), QemuMutex *: qemu_mutex_lock, \
+
On 12/06/21 01:33, Richard Henderson wrote:
- unknown_lock_type))
+/* Auxiliary macros to simplify QEMU_MAKE_LOCABLE. */
+#define QEMU_LOCK_FUNC(x) ((QemuLockUnlockFunc *) \
+_Generic((x), QemuMutex *: qemu_mutex_lock,\
+ QemuRecMutex *: qemu_rec
From: Richard Henderson
This is both more and less complicated than our expansion
using __builtin_choose_expr and __builtin_types_compatible_p.
The expansion through QEMU_MAKE_LOCKABLE_ doesn't work because
we're not emumerating all of the types within the same _Generic,
which results in errors