From fa5bfe577ca439a305e57a42bfbef1d1c87a8912 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Sat, 20 Jan 2024 17:25:24 -0800 Subject: [PATCH] Fixed warnings building for UWP --- src/joystick/windows/SDL_windows_gaming_input.c | 4 ++-- src/thread/stdcpp/SDL_sysmutex.cpp | 2 +- src/thread/stdcpp/SDL_sysrwlock.cpp | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/joystick/windows/SDL_windows_gaming_input.c b/src/joystick/windows/SDL_windows_gaming_input.c index c79cf8e72..21a9374c8 100644 --- a/src/joystick/windows/SDL_windows_gaming_input.c +++ b/src/joystick/windows/SDL_windows_gaming_input.c @@ -61,7 +61,7 @@ typedef struct WindowsGamingInputControllerState int steam_virtual_gamepad_slot; } WindowsGamingInputControllerState; -typedef HRESULT(WINAPI *CoIncrementMTAUsage_t)(PVOID *pCookie); +typedef HRESULT(WINAPI *CoIncrementMTAUsage_t)(CO_MTA_USAGE_COOKIE *pCookie); typedef HRESULT(WINAPI *RoGetActivationFactory_t)(HSTRING activatableClassId, REFIID iid, void **factory); typedef HRESULT(WINAPI *WindowsCreateStringReference_t)(PCWSTR sourceString, UINT32 length, HSTRING_HEADER *hstringHeader, HSTRING *string); typedef HRESULT(WINAPI *WindowsDeleteString_t)(HSTRING string); @@ -626,7 +626,7 @@ static int WGI_JoystickInit(void) * As a workaround, we will keep a reference to the MTA to prevent COM from unloading DLLs later. * See https://github.com/libsdl-org/SDL/issues/5552 for more details. */ - static PVOID cookie = NULL; + static CO_MTA_USAGE_COOKIE cookie = NULL; if (!cookie) { hr = wgi.CoIncrementMTAUsage(&cookie); if (FAILED(hr)) { diff --git a/src/thread/stdcpp/SDL_sysmutex.cpp b/src/thread/stdcpp/SDL_sysmutex.cpp index 48be2f96b..98af40e19 100644 --- a/src/thread/stdcpp/SDL_sysmutex.cpp +++ b/src/thread/stdcpp/SDL_sysmutex.cpp @@ -55,7 +55,7 @@ extern "C" void SDL_LockMutex(SDL_Mutex *mutex) SDL_NO_THREAD_SAFETY_ANALYSIS / if (mutex != NULL) { try { mutex->cpp_mutex.lock(); - } catch (std::system_error &ex) { + } catch (std::system_error &/*ex*/) { SDL_assert(!"Error trying to lock mutex"); // assume we're in a lot of trouble if this assert fails. //return SDL_SetError("unable to lock a C++ mutex: code=%d; %s", ex.code(), ex.what()); } diff --git a/src/thread/stdcpp/SDL_sysrwlock.cpp b/src/thread/stdcpp/SDL_sysrwlock.cpp index 8737ded32..90bca25fb 100644 --- a/src/thread/stdcpp/SDL_sysrwlock.cpp +++ b/src/thread/stdcpp/SDL_sysrwlock.cpp @@ -56,7 +56,7 @@ extern "C" void SDL_LockRWLockForReading(SDL_RWLock *rwlock) SDL_NO_THREAD_SAFET if (rwlock) { try { rwlock->cpp_mutex.lock_shared(); - } catch (std::system_error &ex) { + } catch (std::system_error &/*ex*/) { SDL_assert(!"Error trying to lock rwlock for reading"); // assume we're in a lot of trouble if this assert fails. //return SDL_SetError("unable to lock a C++ rwlock: code=%d; %s", ex.code(), ex.what()); } @@ -69,7 +69,7 @@ extern "C" void SDL_LockRWLockForWriting(SDL_RWLock *rwlock) SDL_NO_THREAD_SAFET try { rwlock->cpp_mutex.lock(); rwlock->write_owner = SDL_GetCurrentThreadID(); - } catch (std::system_error &ex) { + } catch (std::system_error &/*ex*/) { SDL_assert(!"Error trying to lock rwlock for writing"); // assume we're in a lot of trouble if this assert fails. //return SDL_SetError("unable to lock a C++ rwlock: code=%d; %s", ex.code(), ex.what()); }