From 3877545d8c18df7b04771e790e5faf751eb51495 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Fri, 18 Mar 2016 14:05:45 -0700 Subject: Add a workaround for a buggy modff --- Alc/effects/reverb.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'Alc/effects') diff --git a/Alc/effects/reverb.c b/Alc/effects/reverb.c index 504e35b7..5ec5f6cf 100644 --- a/Alc/effects/reverb.c +++ b/Alc/effects/reverb.c @@ -241,6 +241,21 @@ static const ALfloat LATE_LINE_LENGTH[4] = static const ALfloat LATE_LINE_MULTIPLIER = 4.0f; +#if defined(_WIN32) && !defined (_M_X64) && !defined(_M_ARM) +/* HACK: Workaround for a modff bug in 32-bit Windows, which attempts to write + * a 64-bit double to the 32-bit float parameter. + */ +static inline float hack_modff(float x, float *y) +{ + double di; + double df = modf((double)x, &di); + *y = (float)di; + return (float)df; +} +#define modff hack_modff +#endif + + /************************************** * Device Update * **************************************/ -- cgit v1.2.3