From: Paolo Bonzini Date: Fri, 16 Dec 2022 11:53:44 +0000 (+0100) Subject: compiler: introduce QEMU_ANNOTATE X-Git-Tag: v8.2.0-rc0~108^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d79b9202e45711e37e5ba5b3fbfccb4b9fff78a1;p=thirdparty%2Fqemu.git compiler: introduce QEMU_ANNOTATE Allow a more shorter syntax when defining wrapper macros for __attribute__((annotate(...))). Signed-off-by: Paolo Bonzini --- diff --git a/include/qemu/compiler.h b/include/qemu/compiler.h index a309f90c768..7fda29b445f 100644 --- a/include/qemu/compiler.h +++ b/include/qemu/compiler.h @@ -197,4 +197,10 @@ #define BUILTIN_SUBCLL_BROKEN #endif +#if __has_attribute(annotate) +#define QEMU_ANNOTATE(x) __attribute__((annotate(x))) +#else +#define QEMU_ANNOTATE(x) +#endif + #endif /* COMPILER_H */ diff --git a/include/qemu/osdep.h b/include/qemu/osdep.h index 2897720facd..e4a4eb2d613 100644 --- a/include/qemu/osdep.h +++ b/include/qemu/osdep.h @@ -185,7 +185,7 @@ extern "C" { * } */ #ifdef __clang__ -#define coroutine_fn __attribute__((__annotate__("coroutine_fn"))) +#define coroutine_fn QEMU_ANNOTATE("coroutine_fn") #else #define coroutine_fn #endif @@ -195,7 +195,7 @@ extern "C" { * but can handle running in non-coroutine context too. */ #ifdef __clang__ -#define coroutine_mixed_fn __attribute__((__annotate__("coroutine_mixed_fn"))) +#define coroutine_mixed_fn QEMU_ANNOTATE("coroutine_mixed_fn") #else #define coroutine_mixed_fn #endif @@ -224,7 +224,7 @@ extern "C" { * } */ #ifdef __clang__ -#define no_coroutine_fn __attribute__((__annotate__("no_coroutine_fn"))) +#define no_coroutine_fn QEMU_ANNOTATE("no_coroutine_fn") #else #define no_coroutine_fn #endif