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
7af2ce25
Commit
7af2ce25
authored
Jan 02, 2022
by
David Reid
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make log levels an enum instead of defines.
parent
ce0d8f84
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
30 deletions
+8
-30
miniaudio.h
miniaudio.h
+8
-30
No files found.
miniaudio.h
View file @
7af2ce25
...
@@ -646,8 +646,7 @@ You cannot use `-std=c*` compiler flags, nor `-ansi`.
...
@@ -646,8 +646,7 @@ You cannot use `-std=c*` compiler flags, nor `-ansi`.
| | You may need to enable this if your target platform does not allow |
| | You may need to enable this if your target platform does not allow |
| | runtime linking via `dlopen()`. |
| | runtime linking via `dlopen()`. |
+----------------------------------+--------------------------------------------------------------------+
+----------------------------------+--------------------------------------------------------------------+
| MA_DEBUG_OUTPUT | Enable processing of `MA_LOG_LEVEL_DEBUG` messages and `printf()` |
| MA_DEBUG_OUTPUT | Enable `printf()` output of debug logs (`MA_LOG_LEVEL_DEBUG`). |
| | output. |
+----------------------------------+--------------------------------------------------------------------+
+----------------------------------+--------------------------------------------------------------------+
| MA_COINIT_VALUE | Windows only. The value to pass to internal calls to |
| MA_COINIT_VALUE | Windows only. The value to pass to internal calls to |
| | `CoInitializeEx()`. Defaults to `COINIT_MULTITHREADED`. |
| | `CoInitializeEx()`. Defaults to `COINIT_MULTITHREADED`. |
...
@@ -3858,10 +3857,13 @@ MA_LOG_LEVEL_ERROR
...
@@ -3858,10 +3857,13 @@ MA_LOG_LEVEL_ERROR
be fired from within the data callback, in which case the device will be stopped. You should
be fired from within the data callback, in which case the device will be stopped. You should
always have this log level enabled.
always have this log level enabled.
*/
*/
#define MA_LOG_LEVEL_DEBUG 4
typedef enum
#define MA_LOG_LEVEL_INFO 3
{
#define MA_LOG_LEVEL_WARNING 2
MA_LOG_LEVEL_DEBUG = 4,
#define MA_LOG_LEVEL_ERROR 1
MA_LOG_LEVEL_INFO = 3,
MA_LOG_LEVEL_WARNING = 2,
MA_LOG_LEVEL_ERROR = 1
} ma_log_level;
/*
/*
Variables needing to be accessed atomically should be declared with this macro for two reasons:
Variables needing to be accessed atomically should be declared with this macro for two reasons:
...
@@ -12943,18 +12945,6 @@ MA_API ma_result ma_log_postv(ma_log* pLog, ma_uint32 level, const char* pFormat
...
@@ -12943,18 +12945,6 @@ MA_API ma_result ma_log_postv(ma_log* pLog, ma_uint32 level, const char* pFormat
return MA_INVALID_ARGS;
return MA_INVALID_ARGS;
}
}
/*
If it's a debug log, ignore it unless MA_DEBUG_OUTPUT is enabled. Do this before generating the
formatted message string so that we don't waste time only to have ma_log_post() reject it.
*/
#if !defined(MA_DEBUG_OUTPUT)
{
if (level == MA_LOG_LEVEL_DEBUG) {
return MA_INVALID_ARGS; /* Don't post debug messages if debug output is disabled. */
}
}
#endif
#if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || ((!defined(_MSC_VER) || _MSC_VER >= 1900) && !defined(__STRICT_ANSI__) && !defined(_NO_EXT_KEYS))
#if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || ((!defined(_MSC_VER) || _MSC_VER >= 1900) && !defined(__STRICT_ANSI__) && !defined(_NO_EXT_KEYS))
{
{
ma_result result;
ma_result result;
...
@@ -13064,18 +13054,6 @@ MA_API ma_result ma_log_postf(ma_log* pLog, ma_uint32 level, const char* pFormat
...
@@ -13064,18 +13054,6 @@ MA_API ma_result ma_log_postf(ma_log* pLog, ma_uint32 level, const char* pFormat
return MA_INVALID_ARGS;
return MA_INVALID_ARGS;
}
}
/*
If it's a debug log, ignore it unless MA_DEBUG_OUTPUT is enabled. Do this before generating the
formatted message string so that we don't waste time only to have ma_log_post() reject it.
*/
#if !defined(MA_DEBUG_OUTPUT)
{
if (level == MA_LOG_LEVEL_DEBUG) {
return MA_INVALID_ARGS; /* Don't post debug messages if debug output is disabled. */
}
}
#endif
va_start(args, pFormat);
va_start(args, pFormat);
{
{
result = ma_log_postv(pLog, level, pFormat, args);
result = ma_log_postv(pLog, level, pFormat, args);
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