glfw: Revert error denormalization

This commit is contained in:
InKryption 2021-11-22 00:34:38 +01:00 committed by Stephen Gutekanst
parent 44fee8f1f1
commit ef7ada052c
10 changed files with 146 additions and 146 deletions

View file

@ -19,11 +19,11 @@ const internal_debug = @import("internal_debug.zig");
/// @thread_safety This function must only be called from the main thread.
///
/// see also: clipboard, glfwGetClipboardString
pub inline fn setClipboardString(value: [*:0]const u8) error{ PlatformError }!void {
pub inline fn setClipboardString(value: [*:0]const u8) Error!void {
internal_debug.assertInitialized();
c.glfwSetClipboardString(null, value);
getError() catch |err| return switch (err) {
Error.PlatformError => @errSetCast(error{ PlatformError }, err),
Error.PlatformError => err,
else => unreachable,
};
}
@ -45,11 +45,11 @@ pub inline fn setClipboardString(value: [*:0]const u8) error{ PlatformError }!vo
/// @thread_safety This function must only be called from the main thread.
///
/// see also: clipboard, glfwSetClipboardString
pub inline fn getClipboardString() error{ PlatformError }![:0]const u8 {
pub inline fn getClipboardString() Error![:0]const u8 {
internal_debug.assertInitialized();
const value = c.glfwGetClipboardString(null);
getError() catch |err| return switch (err) {
Error.PlatformError => @errSetCast(error{ PlatformError }, err),
Error.PlatformError => err,
else => unreachable,
};
return std.mem.span(value);