marlersoft / zigwin32gen

Generates Complete Zig bindings for Win32. See https://github.com/marlersoft/zigwin32 for the bindings themselves.
108 stars 17 forks source link

Mark calls to meta.declarations as comptime #13

Closed leecannon closed 2 years ago

leecannon commented 2 years ago

On zig master 0.10.0-dev.1649+7e47f106c running zig test win32.zig gives thousands of errors like the below:

./win32/ui/xaml/diagnostics.zig:618:55: error: expected type 'u32', found 'usize'
        @import("std").meta.declarations(@This()).len * 3
                                                      ^
./win32/ui/xaml/diagnostics.zig:618:55: note: unsigned 32-bit int cannot represent all possible unsigned 64-bit values
        @import("std").meta.declarations(@This()).len * 3
                                                      ^
./win32/ui/shell/common.zig:274:55: error: expected type 'u32', found 'usize'
        @import("std").meta.declarations(@This()).len * 3
                                                      ^
./win32/ui/shell/common.zig:274:55: note: unsigned 32-bit int cannot represent all possible unsigned 64-bit values
        @import("std").meta.declarations(@This()).len * 3
                                                      ^
./win32/system/com/structured_storage.zig:1724:55: error: expected type 'u32', found 'usize'
        @import("std").meta.declarations(@This()).len * 3
                                                      ^
./win32/system/com/structured_storage.zig:1724:55: note: unsigned 32-bit int cannot represent all possible unsigned 64-bit values
        @import("std").meta.declarations(@This()).len * 3

It seems like there has been a change requiring explicit comptime markings on both calls to std.meta.declarations.