Fix UWP build in non-UNICODE mode

This commit is contained in:
Anonymous Maarten
2024-07-19 00:28:49 +02:00
committed by Anonymous Maarten
parent c59771d7fc
commit ccebbb6c6e
8 changed files with 25 additions and 25 deletions

View File

@@ -30,23 +30,23 @@
void *SDL_LoadObject(const char *sofile)
{
void *handle;
LPTSTR tstr;
LPWSTR wstr;
if (!sofile) {
SDL_InvalidParamError("sofile");
return NULL;
}
tstr = WIN_UTF8ToString(sofile);
wstr = WIN_UTF8ToStringW(sofile);
#ifdef SDL_PLATFORM_WINRT
/* WinRT only publicly supports LoadPackagedLibrary() for loading .dll
files. LoadLibrary() is a private API, and not available for apps
(that can be published to MS' Windows Store.)
*/
handle = (void *)LoadPackagedLibrary(tstr, 0);
handle = (void *)LoadPackagedLibrary(wstr, 0);
#else
handle = (void *)LoadLibrary(tstr);
handle = (void *)LoadLibrary(wstr);
#endif
SDL_free(tstr);
SDL_free(wstr);
/* Generate an error message if all loads failed */
if (!handle) {