mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-09-29 22:48:30 +00:00
Changed SDL_ClearError() to always return 0.
This will provide a quick and easy way of clearing the error when a function succeeds, if we want to do that in a more widespread way. For now we guarantee that SDL_Init() will never have an error set when it returns successfully. Fixes https://github.com/libsdl-org/SDL/issues/8421
This commit is contained in:
@@ -78,13 +78,14 @@ const char *SDL_GetError(void)
|
||||
}
|
||||
}
|
||||
|
||||
void SDL_ClearError(void)
|
||||
int SDL_ClearError(void)
|
||||
{
|
||||
SDL_error *error = SDL_GetErrBuf(SDL_FALSE);
|
||||
|
||||
if (error) {
|
||||
error->error = SDL_ErrorCodeNone;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Very common errors go here */
|
||||
|
Reference in New Issue
Block a user