marlersoft / zigwin32

Zig bindings for Win32 generated by https://github.com/marlersoft/zigwin32gen
MIT License
234 stars 30 forks source link

Please make per-dll imports i.e. `@import("user32")`, `@import("kernel32")` etc. #21

Open expikr opened 9 months ago

expikr commented 9 months ago

It would be nice if it's just a one-step look up on MSDN docs to find which DLL something is located in and just include that one, rather than having to additionally deal with zigwin32's arbitrary namespace categories.

TUSF commented 8 months ago

How would this work? The metadata these bindings are generated from has DLL names for functions, but not types. Would the bindings generator just include a reference to all types, for every module?

Something like pub usingnamespace @import("alltypes.zig");

I thought maybe the generator could try including only types accessible from the included function signatures, but that doesn't work for COM stuff, because they end up using IUnknown and not its inheriting types.

ethindp commented 6 months ago

I'm pretty sure the categorization is not in fact arbitrary. Instead, this is how the Windows namespace in .NET is organized, as well as the windows rust crate, both of which are similarly generated from the same metadata file.