windows SDL_LoadObject: fix warning after commit 2ff650230d96

This commit is contained in:
Ozkan Sezer 2020-12-13 18:25:02 +03:00
parent 15cbddf497
commit 3c2757ff89
1 changed files with 3 additions and 4 deletions

View File

@ -32,23 +32,22 @@
void * void *
SDL_LoadObject(const char *sofile) SDL_LoadObject(const char *sofile)
{ {
void *handle;
LPTSTR tstr; LPTSTR tstr;
if (!sofile) { if (!sofile) {
SDL_SetError("NULL sofile"); SDL_SetError("NULL sofile");
return NULL; return NULL;
} }
tstr = WIN_UTF8ToString(sofile); tstr = WIN_UTF8ToString(sofile);
#ifdef __WINRT__ #ifdef __WINRT__
/* WinRT only publically supports LoadPackagedLibrary() for loading .dll /* WinRT only publically supports LoadPackagedLibrary() for loading .dll
files. LoadLibrary() is a private API, and not available for apps files. LoadLibrary() is a private API, and not available for apps
(that can be published to MS' Windows Store.) (that can be published to MS' Windows Store.)
*/ */
void *handle = (void *) LoadPackagedLibrary(tstr, 0); handle = (void *) LoadPackagedLibrary(tstr, 0);
#else #else
void *handle = (void *) LoadLibrary(tstr); handle = (void *) LoadLibrary(tstr);
#endif #endif
SDL_free(tstr); SDL_free(tstr);