mirror of
git://repo.or.cz/tinycc.git
synced 2026-06-21 04:14:18 +08:00
winnt.h: add compile-time CONTEXT size assertions for fallback path
The static assertions in tccrun.c only validate CONTEXT when building native Windows ARM64 (_WIN64 && __aarch64__). Cross-compilation builds use the fallback definition without validation, so layout errors would be silent. Add matching C_ASSERT() checks after the ARM64_NT_CONTEXT definition to catch struct layout mismatches during cross-compilation.
This commit is contained in:
parent
680c2d40e8
commit
2203a4407a
@ -1520,6 +1520,20 @@ typedef DWORD LCID;
|
||||
DWORD Wcr[ARM64_MAX_WATCHPOINTS];
|
||||
DWORD64 Wvr[ARM64_MAX_WATCHPOINTS];
|
||||
} ARM64_NT_CONTEXT,*PARM64_NT_CONTEXT;
|
||||
|
||||
C_ASSERT(sizeof(ARM64_NT_CONTEXT) == 0x390);
|
||||
C_ASSERT(offsetof(ARM64_NT_CONTEXT, ContextFlags) == 0x000);
|
||||
C_ASSERT(offsetof(ARM64_NT_CONTEXT, X) == 0x008);
|
||||
C_ASSERT(offsetof(ARM64_NT_CONTEXT, Fp) == 0x0f0);
|
||||
C_ASSERT(offsetof(ARM64_NT_CONTEXT, Lr) == 0x0f8);
|
||||
C_ASSERT(offsetof(ARM64_NT_CONTEXT, Sp) == 0x100);
|
||||
C_ASSERT(offsetof(ARM64_NT_CONTEXT, Pc) == 0x108);
|
||||
C_ASSERT(offsetof(ARM64_NT_CONTEXT, V) == 0x110);
|
||||
C_ASSERT(sizeof(((ARM64_NT_CONTEXT *)0)->V[0]) == 16);
|
||||
C_ASSERT(offsetof(ARM64_NT_CONTEXT, Fpcr) == 0x310);
|
||||
C_ASSERT(offsetof(ARM64_NT_CONTEXT, Fpsr) == 0x314);
|
||||
C_ASSERT(offsetof(ARM64_NT_CONTEXT, Bvr) == 0x338);
|
||||
C_ASSERT(offsetof(ARM64_NT_CONTEXT, Wvr) == 0x380);
|
||||
#endif
|
||||
|
||||
typedef ARM64_NT_CONTEXT CONTEXT,*PCONTEXT;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user