aboutsummaryrefslogtreecommitdiffstats
path: root/Alc
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2016-03-18 14:05:45 -0700
committerChris Robinson <[email protected]>2016-03-18 14:05:45 -0700
commit3877545d8c18df7b04771e790e5faf751eb51495 (patch)
tree774892eed5f1901b8a43e591b7a7a9c6e836f6e1 /Alc
parentce575718ef495c3c146d7a1b443ce556014e057f (diff)
Add a workaround for a buggy modff
Diffstat (limited to 'Alc')
-rw-r--r--Alc/effects/reverb.c15
1 files changed, 15 insertions, 0 deletions
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 *
**************************************/