std.os.windows: avoid dragging in baggage on non-windows

particularly noticeable when usize is not 4 or 8 bytes
This commit is contained in:
Andrew Kelley 2025-08-31 20:39:33 -07:00
parent ec36e0609f
commit fc23fe90ce

View file

@ -4621,6 +4621,8 @@ pub const TEB = extern struct {
};
comptime {
// This file may be referenced for its error sets, so we must not assume target windows here.
if (builtin.os.tag == .windows) {
// Offsets taken from WinDbg info and Geoff Chappell[1] (RIP)
// [1]: https://www.geoffchappell.com/studies/windows/km/ntoskrnl/inc/api/pebteb/teb/index.htm
assert(@offsetOf(TEB, "NtTib") == 0x00);
@ -4641,6 +4643,7 @@ comptime {
assert(@offsetOf(TEB, "LastErrorValue") == 0x68);
assert(@offsetOf(TEB, "TlsSlots") == 0x1480);
}
}
}
pub const EXCEPTION_REGISTRATION_RECORD = extern struct {