Skip to content

Commit 894d1b1

Browse files
committedMay 10, 2021
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>
1 parent 4e1155c commit 894d1b1

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed
 

‎test/util.c

+4
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@
2525

2626
#include "util.h"
2727

28+
#ifndef M_PI
29+
# define M_PI (3.1415926536f)
30+
#endif
31+
2832
void
2933
gen_windowed_sine (float *data, int len, float maximum)
3034
{ int k ;

0 commit comments

Comments
 (0)