mirror of
https://github.com/mackron/miniaudio.git
synced 2026-04-23 16:54:03 +02:00
Fix ma_dlopen() on the GDK build.
This commit is contained in:
+19
-19
@@ -18455,22 +18455,22 @@ MA_API ma_handle ma_dlopen(ma_context* pContext, const char* filename)
|
|||||||
|
|
||||||
ma_log_postf(ma_context_get_log(pContext), MA_LOG_LEVEL_DEBUG, "Loading library: %s\n", filename);
|
ma_log_postf(ma_context_get_log(pContext), MA_LOG_LEVEL_DEBUG, "Loading library: %s\n", filename);
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef MA_WIN32
|
||||||
/* From MSDN: Desktop applications cannot use LoadPackagedLibrary; if a desktop application calls this function it fails with APPMODEL_ERROR_NO_PACKAGE.*/
|
/* From MSDN: Desktop applications cannot use LoadPackagedLibrary; if a desktop application calls this function it fails with APPMODEL_ERROR_NO_PACKAGE.*/
|
||||||
#if !defined(WINAPI_FAMILY) || (defined(WINAPI_FAMILY) && (defined(WINAPI_FAMILY_DESKTOP_APP) && WINAPI_FAMILY == WINAPI_FAMILY_DESKTOP_APP))
|
#if !defined(MA_WIN32_UWP)
|
||||||
handle = (ma_handle)LoadLibraryA(filename);
|
handle = (ma_handle)LoadLibraryA(filename);
|
||||||
|
#else
|
||||||
|
/* *sigh* It appears there is no ANSI version of LoadPackagedLibrary()... */
|
||||||
|
WCHAR filenameW[4096];
|
||||||
|
if (MultiByteToWideChar(CP_UTF8, 0, filename, -1, filenameW, sizeof(filenameW)) == 0) {
|
||||||
|
handle = NULL;
|
||||||
|
} else {
|
||||||
|
handle = (ma_handle)LoadPackagedLibrary(filenameW, 0);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
#else
|
#else
|
||||||
/* *sigh* It appears there is no ANSI version of LoadPackagedLibrary()... */
|
handle = (ma_handle)dlopen(filename, RTLD_NOW);
|
||||||
WCHAR filenameW[4096];
|
|
||||||
if (MultiByteToWideChar(CP_UTF8, 0, filename, -1, filenameW, sizeof(filenameW)) == 0) {
|
|
||||||
handle = NULL;
|
|
||||||
} else {
|
|
||||||
handle = (ma_handle)LoadPackagedLibrary(filenameW, 0);
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
#else
|
|
||||||
handle = (ma_handle)dlopen(filename, RTLD_NOW);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
I'm not considering failure to load a library an error nor a warning because seamlessly falling through to a lower-priority
|
I'm not considering failure to load a library an error nor a warning because seamlessly falling through to a lower-priority
|
||||||
@@ -18493,11 +18493,11 @@ MA_API ma_handle ma_dlopen(ma_context* pContext, const char* filename)
|
|||||||
MA_API void ma_dlclose(ma_context* pContext, ma_handle handle)
|
MA_API void ma_dlclose(ma_context* pContext, ma_handle handle)
|
||||||
{
|
{
|
||||||
#ifndef MA_NO_RUNTIME_LINKING
|
#ifndef MA_NO_RUNTIME_LINKING
|
||||||
#ifdef _WIN32
|
#ifdef MA_WIN32
|
||||||
FreeLibrary((HMODULE)handle);
|
FreeLibrary((HMODULE)handle);
|
||||||
#else
|
#else
|
||||||
dlclose((void*)handle);
|
dlclose((void*)handle);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
(void)pContext;
|
(void)pContext;
|
||||||
#else
|
#else
|
||||||
|
|||||||
Reference in New Issue
Block a user