[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 03/12] osdep.h: move qemu_build_not_reached()
From: |
marcandre . lureau |
Subject: |
[PATCH 03/12] osdep.h: move qemu_build_not_reached() |
Date: |
Thu, 24 Feb 2022 22:36:52 +0400 |
From: Marc-André Lureau <marcandre.lureau@redhat.com>
Move the macro and declaration so it can use glib in the following
patch.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
include/qemu/compiler.h | 16 ----------------
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 0a5e67fb970e..a2d2d48dcf34 100644
--- a/include/qemu/compiler.h
+++ b/include/qemu/compiler.h
@@ -151,22 +151,6 @@
#define QEMU_ALWAYS_INLINE
#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
diff --git a/include/qemu/osdep.h b/include/qemu/osdep.h
index 7bcce3bceb0f..fb72b0006d5c 100644
--- a/include/qemu/osdep.h
+++ b/include/qemu/osdep.h
@@ -157,6 +157,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
--
2.35.1.273.ge6ebfd0e8cbb