im trying to return an integer from a switch case:
run() catch |err| { var sdl_err: i32 = switch (err) { Error.SDL => { logSDLError(); return c.SDL_ShowSimpleMessageBox(c.SDL_MESSAGEBOX_ERROR, error_title, c.SDL_GetError(), error_window); }, Error.IMG => { logIMGError(); return c.SDL_ShowSimpleMessageBox(c.SDL_MESSAGEBOX_ERROR, error_title, c.IMG_GetError(), error_window); }, else => 0, }; if (sdl_err != 0) { logSDLError(); } };
the compiler says ./src/root.zig:125:50: error: expected type 'void', found 'c_int' return c.SDL_ShowSimpleMessageBox(c.SDL_MESSAGEBOX_ERROR, error_title, c.SDL_GetError(), error_window);