mirror of
https://github.com/mackron/miniaudio.git
synced 2026-04-22 00:06:59 +02:00
Fix compiler errors with the Speex resampler and -std=c89.
This commit is contained in:
@@ -29,6 +29,16 @@ int ma_speex_resampler_get_expected_output_frame_count(SpeexResamplerState* st,
|
||||
#endif /* ma_speex_resampler_h */
|
||||
|
||||
#if defined(MINIAUDIO_SPEEX_RESAMPLER_IMPLEMENTATION)
|
||||
/* The Speex resampler uses "inline", which is not defined for C89. We need to define it here. */
|
||||
#if defined(__GNUC__) && !defined(_MSC_VER)
|
||||
#if defined(__STRICT_ANSI__)
|
||||
#if !defined(inline)
|
||||
#define inline __inline__ __attribute__((always_inline))
|
||||
#define MA_SPEEX_INLINE_DEFINED
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(_MSC_VER) && !defined(__clang__)
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable:4244) /* conversion from 'x' to 'y', possible loss of data */
|
||||
@@ -45,6 +55,11 @@ int ma_speex_resampler_get_expected_output_frame_count(SpeexResamplerState* st,
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
|
||||
#if defined(MA_SPEEX_INLINE_DEFINED)
|
||||
#undef inline
|
||||
#undef MA_SPEEX_INLINE_DEFINED
|
||||
#endif
|
||||
|
||||
EXPORT int ma_speex_resampler_get_required_input_frame_count(SpeexResamplerState* st, spx_uint64_t out_len, spx_uint64_t* in_len)
|
||||
{
|
||||
spx_uint64_t count;
|
||||
|
||||
Reference in New Issue
Block a user