From e324e383524190ff81fa15e85634ce5c75c3f4fd Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Fri, 14 Oct 2022 09:53:23 -0700 Subject: [PATCH] workaround stage2 translate-c issue with link to issue --- src/opengl/glad.zig | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/opengl/glad.zig b/src/opengl/glad.zig index d87380191..9d216a28c 100644 --- a/src/opengl/glad.zig +++ b/src/opengl/glad.zig @@ -23,11 +23,13 @@ pub fn load(getProcAddress: anytype) !c_int { } pub fn versionMajor(res: c_int) c_uint { - // The intcast here is due to translate-c weirdness - return c.GLAD_VERSION_MAJOR(@intCast(c_uint, res)); + // https://github.com/ziglang/zig/issues/13162 + // return c.GLAD_VERSION_MAJOR(res); + return @intCast(c_uint, @divTrunc(res, 10000)); } pub fn versionMinor(res: c_int) c_uint { - // The intcast here is due to translate-c weirdness - return c.GLAD_VERSION_MINOR(@intCast(c_uint, res)); + // https://github.com/ziglang/zig/issues/13162 + // return c.GLAD_VERSION_MINOR(res); + return @intCast(c_uint, @mod(res, 10000)); }