url: Patched to compile on C89 compilers.

This commit is contained in:
Ryan C. Gordon 2020-10-05 14:30:33 -04:00
parent 66d847bd5c
commit a3802cc533
1 changed files with 4 additions and 3 deletions

View File

@ -29,15 +29,16 @@
int int
SDL_SYS_OpenURL(const char *url) SDL_SYS_OpenURL(const char *url)
{ {
WCHAR* wurl;
int rc;
/* MSDN says for safety's sake, make sure COM is initialized. */ /* MSDN says for safety's sake, make sure COM is initialized. */
const HRESULT hr = WIN_CoInitialize(); const HRESULT hr = WIN_CoInitialize();
if (FAILED(hr)) { if (FAILED(hr)) {
return WIN_SetErrorFromHRESULT("CoInitialize failed", hr); return WIN_SetErrorFromHRESULT("CoInitialize failed", hr);
} }
WCHAR* wurl = WIN_UTF8ToString(url); wurl = WIN_UTF8ToString(url);
int rc;
if (wurl == NULL) { if (wurl == NULL) {
WIN_CoUninitialize(); WIN_CoUninitialize();
return SDL_OutOfMemory(); return SDL_OutOfMemory();