diff --git a/sdl/error.go b/sdl/error.go index 1d281ac1..9904c09d 100644 --- a/sdl/error.go +++ b/sdl/error.go @@ -6,11 +6,14 @@ package sdl void GoSetError(const char *fmt) { SDL_SetError("%s", fmt); } + */ // #include "sdl_wrapper.h" import "C" import "errors" +var emptyCString *C.char = C.CString("") + // SDL error codes with their corresponding predefined strings. const ( ENOMEM ErrorCode = C.SDL_ENOMEM // out of memory @@ -49,7 +52,7 @@ func SetError(err error) { C.GoSetError(C.CString(err.Error())) return } - C.GoSetError(nil) + C.GoSetError(emptyCString) } // ClearError clears any previous error message.