re-use return value of SDL_SetError/WIN_SetErrorFromHRESULT/SDL_OutOfMemory

This commit is contained in:
pionere
2022-01-17 17:22:30 +01:00
committed by Ryan C. Gordon
parent ebdd536676
commit 60deadba59
18 changed files with 52 additions and 102 deletions

View File

@@ -52,11 +52,9 @@ SDL_SYS_CreateThread(SDL_Thread * thread)
thread->handle = (void *) new std::thread(std::move(cpp_thread));
return 0;
} catch (std::system_error & ex) {
SDL_SetError("unable to start a C++ thread: code=%d; %s", ex.code(), ex.what());
return -1;
return SDL_SetError("unable to start a C++ thread: code=%d; %s", ex.code(), ex.what());
} catch (std::bad_alloc &) {
SDL_OutOfMemory();
return -1;
return SDL_OutOfMemory();
}
}