diff options
author | Marc-André Lureau <marcandre.lureau@redhat.com> | 2022-04-20 17:26:01 +0400 |
---|---|---|
committer | Marc-André Lureau <marcandre.lureau@redhat.com> | 2022-04-21 17:03:51 +0400 |
commit | 94ae6b579d5fa0e4e4ac16b0769350ee853ede8a (patch) | |
tree | 4aef4ab3fd1feab7e5c281d2972a9571fbd44b73 | |
parent | 1812a2d366016becbe127879cc1d9504ccd437a0 (diff) | |
download | qemu-94ae6b579d5fa0e4e4ac16b0769350ee853ede8a.zip qemu-94ae6b579d5fa0e4e4ac16b0769350ee853ede8a.tar.gz qemu-94ae6b579d5fa0e4e4ac16b0769350ee853ede8a.tar.bz2 |
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>
-rw-r--r-- | include/qemu/compiler.h | 16 | ||||
-rw-r--r-- | include/qemu/osdep.h | 16 |
2 files changed, 16 insertions, 16 deletions
diff --git a/include/qemu/compiler.h b/include/qemu/compiler.h index d935985..c13bc8b 100644 --- a/include/qemu/compiler.h +++ b/include/qemu/compiler.h @@ -157,22 +157,6 @@ #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 * switch-case statements, but sometimes the compiler has problems * with those. In that case you can use QEMU_FALLTHROUGH instead. diff --git a/include/qemu/osdep.h b/include/qemu/osdep.h index a733294..848916f 100644 --- a/include/qemu/osdep.h +++ b/include/qemu/osdep.h @@ -169,6 +169,22 @@ extern "C" { #define assert(x) g_assert(x) #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: * WCOREDUMP |