Skip to content

Commit f21ed19

Browse files
committed
Fix fprintf compilation error by including stdio in opus_compare wrapper
1 parent 83c3d7e commit f21ed19

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

test/opus_compare_wrapper.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,17 @@
11
// A wrapper for opus_compare.c which renames the main symbol to avoid conflits
22
// with Haskell, and which disables the use of fprintf.
3+
4+
// First, include stdio to prevent the fprintf definition later from breaking
5+
// the definition of fprintf
6+
#include <stdio.h>
7+
8+
// Rewrite main to opus_compare_main to prevent conflits when FFI-ed
39
#define main opus_compare_main
10+
11+
// Rewrite all fprintf to a no-op
412
#define fprintf(out,fmt,...)
513
#include "opus_compare.c"
14+
15+
// Undefine main and fprintf for safety
616
#undef main
717
#undef fprintf

0 commit comments

Comments
 (0)