mirror of
https://codeberg.org/ziglang/zig.git
synced 2025-12-06 13:54:21 +00:00
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:
parent
ec36e0609f
commit
fc23fe90ce
1 changed files with 22 additions and 19 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue