From fba081e489afe3bbbaf8a27c1d2d6031281ea32a Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Tue, 7 Apr 2020 14:51:08 -0400 Subject: [PATCH] wasapi: Patched to compile on C89 systems, and use SDL_ceilf instead of ceilf. --- src/audio/wasapi/SDL_wasapi.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/audio/wasapi/SDL_wasapi.c b/src/audio/wasapi/SDL_wasapi.c index ea80e53b9b2a8..b00cac528e6df 100644 --- a/src/audio/wasapi/SDL_wasapi.c +++ b/src/audio/wasapi/SDL_wasapi.c @@ -607,9 +607,11 @@ WASAPI_PrepDevice(_THIS, const SDL_bool updatestream) /* Match the callback size to the period size to cut down on the number of interrupts waited for in each call to WaitDevice */ - float period_millis = default_period / 10000.0f; - float period_frames = period_millis * this->spec.freq / 1000.0f; - this->spec.samples = (Uint16)ceil(period_frames); + { + const float period_millis = default_period / 10000.0f; + const float period_frames = period_millis * this->spec.freq / 1000.0f; + this->spec.samples = (Uint16)SDL_ceilf(period_frames); + } /* Update the fragment size as size in bytes */ SDL_CalculateAudioSpec(&this->spec);