Commit 239a6138 authored by David Reid's avatar David Reid

Merge branch 'dev' of https://github.com/mackron/miniaudio into dev

parents 31f4a6c5 a1024dde
...@@ -3816,7 +3816,11 @@ typedef ma_uint16 wchar_t; ...@@ -3816,7 +3816,11 @@ typedef ma_uint16 wchar_t;
#ifdef __unix__ #ifdef __unix__
#define MA_UNIX #define MA_UNIX
#if defined(__DragonFly__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) #ifdef __ORBIS__
#define MA_ORBIS
#elif defined(__PROSPERO__)
#define MA_PROSPERO
#elif defined(__DragonFly__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
#define MA_BSD #define MA_BSD
#endif #endif
#endif #endif
...@@ -6224,7 +6228,7 @@ This section contains the APIs for device playback and capture. Here is where yo ...@@ -6224,7 +6228,7 @@ This section contains the APIs for device playback and capture. Here is where yo
#define MA_SUPPORT_JACK /* JACK is technically supported on Windows, but I don't know how many people use it in practice... */ #define MA_SUPPORT_JACK /* JACK is technically supported on Windows, but I don't know how many people use it in practice... */
#endif #endif
#endif #endif
#if defined(MA_UNIX) #if defined(MA_UNIX) && !defined(MA_ORBIS) && !defined(MA_PROSPERO)
#if defined(MA_LINUX) #if defined(MA_LINUX)
#if !defined(MA_ANDROID) /* ALSA is not supported on Android. */ #if !defined(MA_ANDROID) /* ALSA is not supported on Android. */
#define MA_SUPPORT_ALSA #define MA_SUPPORT_ALSA
...@@ -17411,6 +17415,14 @@ DEVICE I/O ...@@ -17411,6 +17415,14 @@ DEVICE I/O
************************************************************************************************************************************************************* *************************************************************************************************************************************************************
************************************************************************************************************************************************************/ ************************************************************************************************************************************************************/
/* Disable run-time linking on certain backends and platforms. */
#ifndef MA_NO_RUNTIME_LINKING
#if defined(MA_EMSCRIPTEN) || defined(MA_ORBIS) || defined(MA_PROSPERO)
#define MA_NO_RUNTIME_LINKING
#endif
#endif
#ifndef MA_NO_DEVICE_IO #ifndef MA_NO_DEVICE_IO
#ifdef MA_WIN32 #ifdef MA_WIN32
#include <objbase.h> #include <objbase.h>
...@@ -17429,18 +17441,15 @@ DEVICE I/O ...@@ -17429,18 +17441,15 @@ DEVICE I/O
#ifdef MA_POSIX #ifdef MA_POSIX
#include <sys/types.h> #include <sys/types.h>
#include <unistd.h> #include <unistd.h>
#include <dlfcn.h>
#endif
/* No need for dlfcn.h if we're not using runtime linking. */
/* Disable run-time linking on certain backends. */ #ifndef MA_NO_RUNTIME_LINKING
#ifndef MA_NO_RUNTIME_LINKING #include <dlfcn.h>
#if defined(MA_EMSCRIPTEN)
#define MA_NO_RUNTIME_LINKING
#endif #endif
#endif #endif
MA_API void ma_device_info_add_native_data_format(ma_device_info* pDeviceInfo, ma_format format, ma_uint32 channels, ma_uint32 sampleRate, ma_uint32 flags) MA_API void ma_device_info_add_native_data_format(ma_device_info* pDeviceInfo, ma_format format, ma_uint32 channels, ma_uint32 sampleRate, ma_uint32 flags)
{ {
if (pDeviceInfo == NULL) { if (pDeviceInfo == NULL) {
...@@ -17975,6 +17984,7 @@ Dynamic Linking ...@@ -17975,6 +17984,7 @@ Dynamic Linking
*******************************************************************************/ *******************************************************************************/
MA_API ma_handle ma_dlopen(ma_context* pContext, const char* filename) MA_API ma_handle ma_dlopen(ma_context* pContext, const char* filename)
{ {
#ifndef MA_NO_RUNTIME_LINKING
ma_handle handle; ma_handle handle;
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);
...@@ -18006,10 +18016,17 @@ MA_API ma_handle ma_dlopen(ma_context* pContext, const char* filename) ...@@ -18006,10 +18016,17 @@ MA_API ma_handle ma_dlopen(ma_context* pContext, const char* filename)
(void)pContext; /* It's possible for pContext to be unused. */ (void)pContext; /* It's possible for pContext to be unused. */
return handle; return handle;
#else
/* Runtime linking is disabled. */
(void)pContext;
(void)filename;
return NULL;
#endif
} }
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
#ifdef _WIN32 #ifdef _WIN32
FreeLibrary((HMODULE)handle); FreeLibrary((HMODULE)handle);
#else #else
...@@ -18017,10 +18034,16 @@ MA_API void ma_dlclose(ma_context* pContext, ma_handle handle) ...@@ -18017,10 +18034,16 @@ MA_API void ma_dlclose(ma_context* pContext, ma_handle handle)
#endif #endif
(void)pContext; (void)pContext;
#else
/* Runtime linking is disabled. */
(void)pContext;
(void)handle;
#endif
} }
MA_API ma_proc ma_dlsym(ma_context* pContext, ma_handle handle, const char* symbol) MA_API ma_proc ma_dlsym(ma_context* pContext, ma_handle handle, const char* symbol)
{ {
#ifndef MA_NO_RUNTIME_LINKING
ma_proc proc; ma_proc proc;
ma_log_postf(ma_context_get_log(pContext), MA_LOG_LEVEL_DEBUG, "Loading symbol: %s\n", symbol); ma_log_postf(ma_context_get_log(pContext), MA_LOG_LEVEL_DEBUG, "Loading symbol: %s\n", symbol);
...@@ -18044,6 +18067,13 @@ MA_API ma_proc ma_dlsym(ma_context* pContext, ma_handle handle, const char* symb ...@@ -18044,6 +18067,13 @@ MA_API ma_proc ma_dlsym(ma_context* pContext, ma_handle handle, const char* symb
(void)pContext; /* It's possible for pContext to be unused. */ (void)pContext; /* It's possible for pContext to be unused. */
return proc; return proc;
#else
/* Runtime linking is disabled. */
(void)pContext;
(void)handle;
(void)symbol;
return NULL;
#endif
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment