]> Git Repo - qemu.git/blobdiff - include/qemu/osdep.h
osdep.h: move qemu_build_not_reached()
[qemu.git] / include / qemu / osdep.h
index a7332947107ae60002bbe4924042b61ab230c97f..848916f5165c106394b55ddff9e2e91996808b06 100644 (file)
@@ -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
This page took 0.024824 seconds and 4 git commands to generate.