From 667fb97a650dcf9ad50327c7b51f8a95d1e16077 Mon Sep 17 00:00:00 2001 From: "Ronald S. Bultje" Date: Tue, 3 Jul 2012 20:14:09 -0700 Subject: dct/fft-test: use a replacement getopt() if the system has none present. This allows compiling and running these tests on systems lacking a built- in version of getopt(), such as MSVC. Signed-off-by: Anton Khirnov --- libavcodec/dct-test.c | 7 +++++++ libavcodec/fft-test.c | 6 ++++++ 2 files changed, 13 insertions(+) (limited to 'libavcodec') diff --git a/libavcodec/dct-test.c b/libavcodec/dct-test.c index 4647642080..ceff448ae7 100644 --- a/libavcodec/dct-test.c +++ b/libavcodec/dct-test.c @@ -25,10 +25,13 @@ * Started from sample code by Juan J. Sierralta P. */ +#include "config.h" #include #include #include +#if HAVE_UNISTD_H #include +#endif #include #include "libavutil/cpu.h" @@ -474,6 +477,10 @@ static void help(void) "-t speed test\n"); } +#if !HAVE_GETOPT +#include "compat/getopt.c" +#endif + int main(int argc, char **argv) { int test_idct = 0, test_248_dct = 0; diff --git a/libavcodec/fft-test.c b/libavcodec/fft-test.c index 75941a1071..1e4675019c 100644 --- a/libavcodec/fft-test.c +++ b/libavcodec/fft-test.c @@ -34,7 +34,9 @@ #include "rdft.h" #endif #include +#if HAVE_UNISTD_H #include +#endif #include #include @@ -229,6 +231,10 @@ enum tf_transform { TRANSFORM_DCT, }; +#if !HAVE_GETOPT +#include "compat/getopt.c" +#endif + int main(int argc, char **argv) { FFTComplex *tab, *tab1, *tab_ref; -- cgit v1.2.3