The functionality of typeof_strip_qual is provided by the standard library.
Signed-off-by: Paolo Bonzini <pbonz...@redhat.com> --- include/qemu/atomic.h | 5 +++++ include/qemu/osdep.h | 1 + 2 files changed, 6 insertions(+) diff --git a/include/qemu/atomic.h b/include/qemu/atomic.h index 112a29910b..0889a9c5d2 100644 --- a/include/qemu/atomic.h +++ b/include/qemu/atomic.h @@ -26,6 +26,10 @@ * implicit promotion. int and larger types, as well as pointers, can be * converted to a non-qualified type just by applying a binary operator. */ +#ifdef __cplusplus +#define typeof_strip_qual(expr) \ + std::remove_cv<typeof(expr)>::type +#else #define typeof_strip_qual(expr) \ typeof( \ __builtin_choose_expr( \ @@ -59,6 +63,7 @@ __builtin_types_compatible_p(typeof(expr), const volatile unsigned short), \ (unsigned short)1, \ (expr)+0)))))) +#endif #ifndef __ATOMIC_RELAXED #error "Expecting C11 atomic ops" diff --git a/include/qemu/osdep.h b/include/qemu/osdep.h index c9ec7830c9..28707bbde3 100644 --- a/include/qemu/osdep.h +++ b/include/qemu/osdep.h @@ -140,6 +140,7 @@ QEMU_EXTERN_C int daemon(int, int); #endif #ifdef __cplusplus +#include <type_traits> extern "C" { #endif -- 2.35.1