mirror of https://github.com/xemu-project/xemu.git
osdep.h: move qemu_build_not_reached()
Move the macro and declaration so it can use glib in the following patch (it already depends on glib anyway for !optimize) Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Message-Id: <20220420132624.2439741-19-marcandre.lureau@redhat.com>
This commit is contained in:
parent
1812a2d366
commit
94ae6b579d
|
@ -156,22 +156,6 @@
|
||||||
#define QEMU_ALWAYS_INLINE
|
#define QEMU_ALWAYS_INLINE
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/**
|
|
||||||
* qemu_build_not_reached()
|
|
||||||
*
|
|
||||||
* The compiler, during optimization, is expected to prove that a call
|
|
||||||
* to this function cannot be reached and remove it. If the compiler
|
|
||||||
* supports QEMU_ERROR, this will be reported at compile time; otherwise
|
|
||||||
* this will be reported at link time due to the missing symbol.
|
|
||||||
*/
|
|
||||||
extern void QEMU_NORETURN QEMU_ERROR("code path is reachable")
|
|
||||||
qemu_build_not_reached_always(void);
|
|
||||||
#if defined(__OPTIMIZE__) && !defined(__NO_INLINE__)
|
|
||||||
#define qemu_build_not_reached() qemu_build_not_reached_always()
|
|
||||||
#else
|
|
||||||
#define qemu_build_not_reached() g_assert_not_reached()
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* In most cases, normal "fallthrough" comments are good enough for
|
* In most cases, normal "fallthrough" comments are good enough for
|
||||||
* switch-case statements, but sometimes the compiler has problems
|
* switch-case statements, but sometimes the compiler has problems
|
||||||
|
|
|
@ -169,6 +169,22 @@ extern "C" {
|
||||||
#define assert(x) g_assert(x)
|
#define assert(x) g_assert(x)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/**
|
||||||
|
* qemu_build_not_reached()
|
||||||
|
*
|
||||||
|
* The compiler, during optimization, is expected to prove that a call
|
||||||
|
* to this function cannot be reached and remove it. If the compiler
|
||||||
|
* supports QEMU_ERROR, this will be reported at compile time; otherwise
|
||||||
|
* this will be reported at link time due to the missing symbol.
|
||||||
|
*/
|
||||||
|
extern void QEMU_NORETURN QEMU_ERROR("code path is reachable")
|
||||||
|
qemu_build_not_reached_always(void);
|
||||||
|
#if defined(__OPTIMIZE__) && !defined(__NO_INLINE__)
|
||||||
|
#define qemu_build_not_reached() qemu_build_not_reached_always()
|
||||||
|
#else
|
||||||
|
#define qemu_build_not_reached() g_assert_not_reached()
|
||||||
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* According to waitpid man page:
|
* According to waitpid man page:
|
||||||
* WCOREDUMP
|
* WCOREDUMP
|
||||||
|
|
Loading…
Reference in New Issue