Commit c433e029 authored by David Reid's avatar David Reid

Fix compilation errors on GCC.

parent 31f49a7c
...@@ -5481,6 +5481,7 @@ IMPLEMENTATION ...@@ -5481,6 +5481,7 @@ IMPLEMENTATION
#include <limits.h> /* For INT_MAX */ #include <limits.h> /* For INT_MAX */
#include <math.h> /* sin(), etc. */ #include <math.h> /* sin(), etc. */
#include <stdarg.h>
#include <stdio.h> #include <stdio.h>
#if !defined(_MSC_VER) && !defined(__DMC__) #if !defined(_MSC_VER) && !defined(__DMC__)
#include <strings.h> /* For strcasecmp(). */ #include <strings.h> /* For strcasecmp(). */
...@@ -7837,7 +7838,7 @@ static void ma_post_log_message(ma_context* pContext, ma_device* pDevice, ma_uin ...@@ -7837,7 +7838,7 @@ static void ma_post_log_message(ma_context* pContext, ma_device* pDevice, ma_uin
/* Posts a formatted log message. */ /* Posts a formatted log message. */
static void ma_post_log_messagev(ma_context* pContext, ma_device* pDevice, ma_uint32 logLevel, const char* pFormat, va_list args) static void ma_post_log_messagev(ma_context* pContext, ma_device* pDevice, ma_uint32 logLevel, const char* pFormat, va_list args)
{ {
#if !defined(_MSC_VER) || _MSC_VER >= 1900 #if (!defined(_MSC_VER) || _MSC_VER >= 1900) && !defined(__STRICT_ANSI__)
{ {
char pFormattedMessage[1024]; char pFormattedMessage[1024];
vsnprintf(pFormattedMessage, sizeof(pFormattedMessage), pFormat, args); vsnprintf(pFormattedMessage, sizeof(pFormattedMessage), pFormat, args);
...@@ -7884,12 +7885,19 @@ static void ma_post_log_messagev(ma_context* pContext, ma_device* pDevice, ma_ui ...@@ -7884,12 +7885,19 @@ static void ma_post_log_messagev(ma_context* pContext, ma_device* pDevice, ma_ui
ma_free(pFormattedMessage, pAllocationCallbacks); ma_free(pFormattedMessage, pAllocationCallbacks);
} }
} }
#else
/* Can't do anything because we don't have a safe way of to emulate vsnprintf() without a manual solution. */
(void)pContext;
(void)pDevice;
(void)logLevel;
(void)pFormat;
(void)args;
#endif #endif
} }
#endif #endif
} }
static void ma_post_log_messagef(ma_context* pContext, ma_device* pDevice, ma_uint32 logLevel, const char* pFormat, ...) static MA_INLINE void ma_post_log_messagef(ma_context* pContext, ma_device* pDevice, ma_uint32 logLevel, const char* pFormat, ...)
{ {
va_list args; va_list args;
va_start(args, pFormat); va_start(args, pFormat);
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