https://git.reactos.org/?p=reactos.git;a=commitdiff;h=f7024d6c72f46d9125d7a…
commit f7024d6c72f46d9125d7acfe23093dea4ffa3012
Author: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org>
AuthorDate: Thu Nov 24 03:22:39 2022 +0100
Commit: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org>
CommitDate: Thu Nov 24 13:30:43 2022 +0100
[PSDK][NTOS:KD64] Turns out, that even Clang in MSVC mode needs the 64-bits pointer
extension hack!
Addendum to commit de81021ba.
Otherwise, we get the following build error:
\ntoskrnl\kd64\kddata.c(532,5): error: initializer element is not a compile-time
constant
PtrToUL64(RtlpBreakWithStatusInstruction),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
\ntoskrnl\kd64\kddata.c(526,26): note: expanded from macro 'PtrToUL64'
#define PtrToUL64(x) ((ULPTR64)(x))
^~~~~~~~~~~~
---
ntoskrnl/kd64/kddata.c | 4 ++--
sdk/include/psdk/wdbgexts.h | 3 ++-
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/ntoskrnl/kd64/kddata.c b/ntoskrnl/kd64/kddata.c
index 7111d287d0a..dbe56351db1 100644
--- a/ntoskrnl/kd64/kddata.c
+++ b/ntoskrnl/kd64/kddata.c
@@ -519,8 +519,8 @@ DBGKD_GET_VERSION64 KdVersionBlock =
C_ASSERT(sizeof(KDDEBUGGER_DATA64) >= 0x318);
#endif
-/* Minimal hackery for GCC, see commit b9cd3f2d9 (r25845) */
-#if defined(__GNUC__) && defined(_M_IX86)
+#if !defined(_WIN64) && (defined(__GNUC__) || defined(__clang__))
+/* Minimal hackery for GCC/Clang, see commit b9cd3f2d9 (r25845) and de81021ba */
#define PtrToUL64(x) ((ULPTR64)(ULONG_PTR)(x))
#else
#define PtrToUL64(x) ((ULPTR64)(x))
diff --git a/sdk/include/psdk/wdbgexts.h b/sdk/include/psdk/wdbgexts.h
index d682814a7dc..bf8ff3d724e 100644
--- a/sdk/include/psdk/wdbgexts.h
+++ b/sdk/include/psdk/wdbgexts.h
@@ -175,7 +175,8 @@ typedef struct _DBGKD_DEBUG_DATA_HEADER64
} DBGKD_DEBUG_DATA_HEADER64, *PDBGKD_DEBUG_DATA_HEADER64;
/* Self-documenting type: stores a pointer as a 64-bit quantity */
-#if defined(__GNUC__) && defined(_M_IX86) // See commit b9cd3f2d9 (r25845)
+#if !defined(_WIN64) && (defined(__GNUC__) || defined(__clang__))
+/* Minimal hackery for GCC/Clang, see commit b9cd3f2d9 (r25845) and de81021ba */
typedef union _ULPTR64
{
ULONG_PTR ptr;