From 5874e403e14eabaf9c6596d2df5b6db6dd4acdcf Mon Sep 17 00:00:00 2001 From: Autumn! Date: Wed, 24 May 2023 20:37:02 +0000 Subject: Correct return type wrapping of Mix_Init() Signed-off-by: Autumn! --- sdl2/mixer/general.ha | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sdl2/mixer/general.ha b/sdl2/mixer/general.ha index 4f819bf..87a729f 100644 --- a/sdl2/mixer/general.ha +++ b/sdl2/mixer/general.ha @@ -29,7 +29,9 @@ export def MIX_DEFAULT_FORMAT: sdl2::SDL_AudioFormat = sdl2::AUDIO_S16LSB; // Loads dynamic libraries and prepares them for use. Flags should be // one or more flags from [[MIX_InitFlags]] OR'd together. export fn Mix_Init(flags: MIX_InitFlags) (void | sdl2::error) = { - return sdl2::wrapvoid(_Mix_Init(flags)); + if (flags & _Mix_Init(flags) != flags) { + return "Mixer flags not initialized": sdl2::error; + }; }; // Unloads libraries loaded with [[Mix_Init]]. -- cgit v1.2.3