Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
M
miniaudio
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
MyCard
miniaudio
Commits
8eec6da4
Commit
8eec6da4
authored
Nov 20, 2022
by
David Reid
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Unify the MA_NO_DLOPEN and MA_NO_RUNTIME_LINKING options.
parent
bf64bc79
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
18 deletions
+17
-18
miniaudio.h
miniaudio.h
+17
-18
No files found.
miniaudio.h
View file @
8eec6da4
...
@@ -17404,6 +17404,14 @@ DEVICE I/O
...
@@ -17404,6 +17404,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>
...
@@ -17422,25 +17430,13 @@ DEVICE I/O
...
@@ -17422,25 +17430,13 @@ DEVICE I/O
#ifdef MA_POSIX
#ifdef MA_POSIX
#include <sys/types.h>
#include <sys/types.h>
#include <unistd.h>
#include <unistd.h>
#endif
#ifndef MA_NO_DLOPEN
/* No need for dlfcn.h if we're not using runtime linking. */
#if
defined(MA_POSIX) && (defined(MA_ORBIS) || defined(MA_PROSPERO))
#if
ndef MA_NO_RUNTIME_LINKING
#
define MA_NO_DLOPEN
#
include <dlfcn.h>
#endif
#endif
#endif
#endif
#ifndef MA_NO_DLOPEN
#include <dlfcn.h>
#endif
/* Disable run-time linking on certain backends. */
#ifndef MA_NO_RUNTIME_LINKING
#if defined(MA_NO_DLOPEN) || defined(MA_EMSCRIPTEN)
#define MA_NO_RUNTIME_LINKING
#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)
...
@@ -17977,7 +17973,7 @@ Dynamic Linking
...
@@ -17977,7 +17973,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_
DLOPEN
#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);
...
@@ -18010,6 +18006,7 @@ MA_API ma_handle ma_dlopen(ma_context* pContext, const char* filename)
...
@@ -18010,6 +18006,7 @@ 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
#else
/* Runtime linking is disabled. */
(void)pContext;
(void)pContext;
(void)filename;
(void)filename;
return NULL;
return NULL;
...
@@ -18018,7 +18015,7 @@ MA_API ma_handle ma_dlopen(ma_context* pContext, const char* filename)
...
@@ -18018,7 +18015,7 @@ 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_
DLOPEN
#ifndef MA_NO_
RUNTIME_LINKING
#ifdef _WIN32
#ifdef _WIN32
FreeLibrary((HMODULE)handle);
FreeLibrary((HMODULE)handle);
#else
#else
...
@@ -18027,6 +18024,7 @@ MA_API void ma_dlclose(ma_context* pContext, ma_handle handle)
...
@@ -18027,6 +18024,7 @@ MA_API void ma_dlclose(ma_context* pContext, ma_handle handle)
(void)pContext;
(void)pContext;
#else
#else
/* Runtime linking is disabled. */
(void)pContext;
(void)pContext;
(void)handle;
(void)handle;
#endif
#endif
...
@@ -18034,7 +18032,7 @@ MA_API void ma_dlclose(ma_context* pContext, ma_handle handle)
...
@@ -18034,7 +18032,7 @@ MA_API void ma_dlclose(ma_context* pContext, ma_handle handle)
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_
DLOPEN
#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);
...
@@ -18059,6 +18057,7 @@ MA_API ma_proc ma_dlsym(ma_context* pContext, ma_handle handle, const char* symb
...
@@ -18059,6 +18057,7 @@ 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
#else
/* Runtime linking is disabled. */
(void)pContext;
(void)pContext;
(void)handle;
(void)handle;
(void)symbol;
(void)symbol;
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment