glfw: force init error type work around

This commit is contained in:
InKryption 2021-11-21 20:42:32 +01:00 committed by Stephen Gutekanst
parent 9f241b5109
commit 44fee8f1f1
10 changed files with 67 additions and 69 deletions

View file

@ -23,7 +23,7 @@ pub inline fn setClipboardString(value: [*:0]const u8) error{ PlatformError }!vo
internal_debug.assertInitialized();
c.glfwSetClipboardString(null, value);
getError() catch |err| return switch (err) {
Error.PlatformError => err,
Error.PlatformError => @errSetCast(error{ PlatformError }, err),
else => unreachable,
};
}
@ -49,7 +49,7 @@ pub inline fn getClipboardString() error{ PlatformError }![:0]const u8 {
internal_debug.assertInitialized();
const value = c.glfwGetClipboardString(null);
getError() catch |err| return switch (err) {
Error.PlatformError => err,
Error.PlatformError => @errSetCast(error{ PlatformError }, err),
else => unreachable,
};
return std.mem.span(value);