#Is there a universal way of using winapi in zig?

1 messages · Page 1 of 1 (latest)

steady helm
#

Writing the extern declarations is calling the OS directly.

#

The issue is that that translate-c isn't good enough at converting the SDK headers into something usable. The ZigWin32 is probably the best long term way to do that, since it is generated from the WinMDs, the same as how Microsoft's own Rust Win32 windows bindings are generated.

steady helm
#

Win32 API is full of very low-level hackery (e.g. mixed ATOMs (constants) and pointers) that just don't map to Zig. Partly coming from ancient backward-compatible legacy roots reaching back to 16-bit systems with 640k of memory.

gloomy scaffold
#

the mentioned hackery, and inefficient, excessive implementations are the reason zig std almost exclusively calls into lower level windows libs/apis