coroutine: Move coroutine_fn to qemu/osdep.h, trim includes
block/block-hmp-cmds.h and qemu/co-shared-resource.h use coroutine_fn without including qemu/coroutine.h. They compile only if it's already included from elsewhere. I could fix that, but pulling in qemu/coroutine.h and everything it includes just for a macro that expands into nothing feels silly. Instead, move the macro to qemu/osdep.h. Inclusions of qemu/coroutine.h just for coroutine_fn become superfluous. Drop them. Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Message-Id: <20221221131435.3851212-3-armbru@redhat.com>
This commit is contained in:
@@ -157,6 +157,22 @@ extern "C" {
|
||||
|
||||
#include "qemu/typedefs.h"
|
||||
|
||||
/**
|
||||
* Mark a function that executes in coroutine context
|
||||
*
|
||||
* Functions that execute in coroutine context cannot be called directly from
|
||||
* normal functions. In the future it would be nice to enable compiler or
|
||||
* static checker support for catching such errors. This annotation might make
|
||||
* it possible and in the meantime it serves as documentation.
|
||||
*
|
||||
* For example:
|
||||
*
|
||||
* static void coroutine_fn foo(void) {
|
||||
* ....
|
||||
* }
|
||||
*/
|
||||
#define coroutine_fn
|
||||
|
||||
/*
|
||||
* For mingw, as of v6.0.0, the function implementing the assert macro is
|
||||
* not marked as noreturn, so the compiler cannot delete code following an
|
||||
|
||||
Reference in New Issue
Block a user