From a3802cc533cc8f7c68acccd06ddafa64caaedcdf Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Mon, 5 Oct 2020 14:30:33 -0400 Subject: [PATCH] url: Patched to compile on C89 compilers. --- src/misc/windows/SDL_sysurl.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/misc/windows/SDL_sysurl.c b/src/misc/windows/SDL_sysurl.c index a6bdc07e3..ad77b77f9 100644 --- a/src/misc/windows/SDL_sysurl.c +++ b/src/misc/windows/SDL_sysurl.c @@ -29,15 +29,16 @@ int SDL_SYS_OpenURL(const char *url) { + WCHAR* wurl; + int rc; + /* MSDN says for safety's sake, make sure COM is initialized. */ const HRESULT hr = WIN_CoInitialize(); if (FAILED(hr)) { return WIN_SetErrorFromHRESULT("CoInitialize failed", hr); } - WCHAR* wurl = WIN_UTF8ToString(url); - int rc; - + wurl = WIN_UTF8ToString(url); if (wurl == NULL) { WIN_CoUninitialize(); return SDL_OutOfMemory();