workaround stage2 translate-c issue with link to issue

This commit is contained in:
Mitchell Hashimoto
2022-10-14 09:53:23 -07:00
parent b28b04d710
commit e324e38352

View File

@ -23,11 +23,13 @@ pub fn load(getProcAddress: anytype) !c_int {
} }
pub fn versionMajor(res: c_int) c_uint { pub fn versionMajor(res: c_int) c_uint {
// The intcast here is due to translate-c weirdness // https://github.com/ziglang/zig/issues/13162
return c.GLAD_VERSION_MAJOR(@intCast(c_uint, res)); // return c.GLAD_VERSION_MAJOR(res);
return @intCast(c_uint, @divTrunc(res, 10000));
} }
pub fn versionMinor(res: c_int) c_uint { pub fn versionMinor(res: c_int) c_uint {
// The intcast here is due to translate-c weirdness // https://github.com/ziglang/zig/issues/13162
return c.GLAD_VERSION_MINOR(@intCast(c_uint, res)); // return c.GLAD_VERSION_MINOR(res);
return @intCast(c_uint, @mod(res, 10000));
} }