https://git.reactos.org/?p=reactos.git;a=commitdiff;h=f7c58468f1ae94ae11c32…
commit f7c58468f1ae94ae11c3285398bd68cc76484a57
Author: Victor Perevertkin <victor.perevertkin(a)reactos.org>
AuthorDate: Thu Sep 24 05:35:43 2020 +0300
Commit: Victor Perevertkin <victor.perevertkin(a)reactos.org>
CommitDate: Thu Sep 24 05:35:43 2020 +0300
[XDK] Move UNREACHABLE macro definition to ntbasedef.h
---
ntoskrnl/include/internal/i386/trap_x.h | 5 -----
sdk/include/xdk/ntbasedef.h | 8 ++++++++
2 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/ntoskrnl/include/internal/i386/trap_x.h
b/ntoskrnl/include/internal/i386/trap_x.h
index cd79c2a40c4..1f1e96f04d0 100644
--- a/ntoskrnl/include/internal/i386/trap_x.h
+++ b/ntoskrnl/include/internal/i386/trap_x.h
@@ -9,12 +9,7 @@
#pragma once
#if defined(_MSC_VER)
-#define UNREACHABLE __assume(0)
#define __builtin_expect(a,b) (a)
-#elif defined(__GNUC__)
-#define UNREACHABLE __builtin_unreachable()
-#else
-#error
#endif
//
diff --git a/sdk/include/xdk/ntbasedef.h b/sdk/include/xdk/ntbasedef.h
index 2118935a35c..c87be90a7a0 100644
--- a/sdk/include/xdk/ntbasedef.h
+++ b/sdk/include/xdk/ntbasedef.h
@@ -800,6 +800,14 @@ $endif(_WINNT_)
#define DEFAULT_UNREACHABLE default: break
#endif
+#if defined(__GNUC__) || defined(__clang__)
+ #define UNREACHABLE __builtin_unreachable()
+#elif defined(_MSC_VER)
+ #define UNREACHABLE __assume(0)
+#else
+ #define UNREACHABLE
+#endif
+
#define VER_WORKSTATION_NT 0x40000000
#define VER_SERVER_NT 0x80000000
#define VER_SUITE_SMALLBUSINESS 0x00000001