Commit 9af027d4 authored by David Reid's avatar David Reid

Fix non-Windows builds.

parent ad130c35
...@@ -2892,6 +2892,13 @@ mal_bool32 mal_event_signal(mal_event* pEvent) ...@@ -2892,6 +2892,13 @@ mal_bool32 mal_event_signal(mal_event* pEvent)
} }
#if defined(_MSC_VER)
#pragma warning(push)
#pragma warning(disable:4505)
#elif defined(__GNUC__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-function"
#endif
static mal_uint32 mal_get_best_sample_rate_within_range(mal_uint32 sampleRateMin, mal_uint32 sampleRateMax) static mal_uint32 mal_get_best_sample_rate_within_range(mal_uint32 sampleRateMin, mal_uint32 sampleRateMax)
{ {
// Normalize the range in case we were given something stupid. // Normalize the range in case we were given something stupid.
...@@ -2909,7 +2916,7 @@ static mal_uint32 mal_get_best_sample_rate_within_range(mal_uint32 sampleRateMin ...@@ -2909,7 +2916,7 @@ static mal_uint32 mal_get_best_sample_rate_within_range(mal_uint32 sampleRateMin
return sampleRateMax; return sampleRateMax;
} else { } else {
for (size_t iStandardRate = 0; iStandardRate < mal_countof(g_malStandardSampleRatePriorities); ++iStandardRate) { for (size_t iStandardRate = 0; iStandardRate < mal_countof(g_malStandardSampleRatePriorities); ++iStandardRate) {
DWORD standardRate = g_malStandardSampleRatePriorities[iStandardRate]; mal_uint32 standardRate = g_malStandardSampleRatePriorities[iStandardRate];
if (standardRate >= sampleRateMin && standardRate <= sampleRateMax) { if (standardRate >= sampleRateMin && standardRate <= sampleRateMax) {
return standardRate; return standardRate;
} }
...@@ -2920,6 +2927,11 @@ static mal_uint32 mal_get_best_sample_rate_within_range(mal_uint32 sampleRateMin ...@@ -2920,6 +2927,11 @@ static mal_uint32 mal_get_best_sample_rate_within_range(mal_uint32 sampleRateMin
mal_assert(MAL_FALSE); mal_assert(MAL_FALSE);
return 0; return 0;
} }
#if defined(_MSC_VER)
#pragma warning(pop)
#elif defined(__GNUC__)
#pragma GCC diagnostic pop
#endif
// Posts a log message. // Posts a log message.
...@@ -3518,7 +3530,6 @@ static mal_result mal_device__main_loop__null(mal_device* pDevice) ...@@ -3518,7 +3530,6 @@ static mal_result mal_device__main_loop__null(mal_device* pDevice)
#define mal_CoTaskMemFree(pContext, pv) CoTaskMemFree(pv) #define mal_CoTaskMemFree(pContext, pv) CoTaskMemFree(pv)
#define mal_PropVariantClear(pContext, pvar) PropVariantClear(pvar) #define mal_PropVariantClear(pContext, pvar) PropVariantClear(pvar)
#endif #endif
#endif
// There's a few common headers for Win32 backends which include here for simplicity. Note that we should never // There's a few common headers for Win32 backends which include here for simplicity. Note that we should never
// include any files that do not come standard with modern compilers, and we may need to manually define a few // include any files that do not come standard with modern compilers, and we may need to manually define a few
...@@ -3741,6 +3752,7 @@ static mal_format mal_format_from_WAVEFORMATEX(WAVEFORMATEX* pWF) ...@@ -3741,6 +3752,7 @@ static mal_format mal_format_from_WAVEFORMATEX(WAVEFORMATEX* pWF)
return mal_format_unknown; return mal_format_unknown;
} }
#endif
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
...@@ -7338,6 +7350,7 @@ static mal_result mal_device_init__alsa(mal_context* pContext, mal_device_type t ...@@ -7338,6 +7350,7 @@ static mal_result mal_device_init__alsa(mal_context* pContext, mal_device_type t
return mal_post_error(pDevice, "[ALSA] The chosen format is not supported by mini_al.", MAL_FORMAT_NOT_SUPPORTED); return mal_post_error(pDevice, "[ALSA] The chosen format is not supported by mini_al.", MAL_FORMAT_NOT_SUPPORTED);
} }
// Channels. // Channels.
mal_uint32 channels = pConfig->channels; mal_uint32 channels = pConfig->channels;
if (((mal_snd_pcm_hw_params_set_channels_near_proc)pContext->alsa.snd_pcm_hw_params_set_channels_near)((mal_snd_pcm_t*)pDevice->alsa.pPCM, pHWParams, &channels) < 0) { if (((mal_snd_pcm_hw_params_set_channels_near_proc)pContext->alsa.snd_pcm_hw_params_set_channels_near)((mal_snd_pcm_t*)pDevice->alsa.pPCM, pHWParams, &channels) < 0) {
......
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