aboutsummaryrefslogtreecommitdiff
path: root/src/Module.zig
diff options
context:
space:
mode:
authorRyan Liptak <squeek502@hotmail.com>2022-10-13 21:11:58 -0700
committerAndrew Kelley <andrew@ziglang.org>2022-10-14 15:23:13 -0400
commit8bb2e96ac3b61a8aa393f250144fb9e1195ca60a (patch)
treecf37940f5d9711cbacb6ae2d6618e9c62b1b05bb /src/Module.zig
parente4e1c21e1fa599c1f243cad9236c88676023f6a8 (diff)
downloadzig-8bb2e96ac3b61a8aa393f250144fb9e1195ca60a.tar.gz
zig-8bb2e96ac3b61a8aa393f250144fb9e1195ca60a.zip
std.os.windows: Change HKEY to *opaque {}
The definition of HKEY__ as a struct with an unused int field is only the case in the Windows headers when `STRICT` is defined. From https://learn.microsoft.com/en-us/windows/win32/winprog/enabling-strict: > When STRICT is defined, data type definitions change as follows: > > - Specific handle types are defined to be mutually exclusive; for example, you will not be able to pass an HWND where an HDC type argument is required. Without STRICT, all handles are defined as HANDLE, so the compiler does not prevent you from using one type of handle where another type is expected. Zig's `opaque {}` already gives this benefit to us, so the usage of a struct with an unused field is unnecessary, and it was causing HKEY to have an alignment of 4, which is a problem because there are HKEY constants like HKEY_LOCAL_MACHINE (0x80000002) that are not 4-byte aligned. Without this change, the compiler would not allow something like HKEY_LOCAL_MACHINE to be defined since it enforces pointer alignment.
Diffstat (limited to 'src/Module.zig')
0 files changed, 0 insertions, 0 deletions