From 95f48b28c70bb52d1d660d1c3b98417bf0c6a015 Mon Sep 17 00:00:00 2001 From: kayomn Date: Tue, 4 Oct 2022 14:20:32 +0100 Subject: [PATCH] Fix compilation error when calling runGraphics --- src/main.zig | 2 +- src/sys.zig | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main.zig b/src/main.zig index 4108ff8..4b83a2b 100644 --- a/src/main.zig +++ b/src/main.zig @@ -11,7 +11,7 @@ const sys = @import("./sys.zig"); /// Entry point. /// pub fn main() anyerror!void { - return sys.runGraphics(anyerror, run); + return nosuspend sys.runGraphics(anyerror, run); } test { diff --git a/src/sys.zig b/src/sys.zig index ff5755f..7864d70 100644 --- a/src/sys.zig +++ b/src/sys.zig @@ -616,13 +616,13 @@ pub const GraphicsContext = opaque { /// /// pub fn GraphicsRunner(comptime Errors: type) type { - return fn (*EventLoop, *GraphicsContext) Errors!void; + return fn (*EventLoop, *GraphicsContext) callconv(.Async) Errors!void; } /// /// /// -pub fn runGraphics(comptime Errors: anytype, run: GraphicsRunner(Errors)) Errors!void { +pub fn runGraphics(comptime Errors: anytype, comptime run: GraphicsRunner(Errors)) Errors!void { if (ext.SDL_Init(ext.SDL_INIT_EVERYTHING) != 0) { ext.SDL_LogCritical(ext.SDL_LOG_CATEGORY_APPLICATION, "Failed to initialize runtime");