summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRalph Giles <giles@thaumas.net>2021-05-09 11:59:17 -0700
committerRalph Giles <giles@thaumas.net>2021-05-09 22:08:51 -0700
commit894d1b1f22f2fb8ab6d3aeba863e143416c71ce2 (patch)
tree13ce3c201a0ff39c867901c5c3a5f24768f8c84c
parent4e1155cc77a2c672f3dd18f9a32dbf1404693289 (diff)
downloadlibvorbis-git-894d1b1f22f2fb8ab6d3aeba863e143416c71ce2.tar.gz
Fix tests on MSVC.
Copy the fallback M_PI define from lib/os.h to test/util.c so the symbol is available under Microsoft's compiler, which doesn't supply it by default. (This can be changed by defining _USE_MATH_DEFINES before including math.h.) The os.h fallback is used when compiling the main codec library, but is not used in the external test harness, so compiling that was failing with CMake under Windows. Signed-off-by: evpobr <evpobr@gmail.com>
-rw-r--r--test/util.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/test/util.c b/test/util.c
index 3dc1597c..6415b294 100644
--- a/test/util.c
+++ b/test/util.c
@@ -25,6 +25,10 @@
#include "util.h"
+#ifndef M_PI
+# define M_PI (3.1415926536f)
+#endif
+
void
gen_windowed_sine (float *data, int len, float maximum)
{ int k ;