Commit cfa9ecfa authored by David Reid's avatar David Reid

Fix compiler errors with the Speex resampler and -std=c89.

parent f2dd3159
......@@ -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;
......
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