From 15caccb9be2a50ffe0dabd3202bcc272d1d7ff1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Storsj=C3=B6?= Date: Thu, 29 Nov 2012 17:02:24 +0200 Subject: [PATCH 1/2] cmdutils: Use a configure check for enabling CommandLineToArgvW MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This simplifies the condition to avoid hardcoding the systems where the function exists. This also simplifies support for newer Windows API subsets where this function doesn't exist, such as Windows Phone 8 and the "metro" API subset of Windows 8. Signed-off-by: Martin Storsjö --- cmdutils.c | 4 ++-- configure | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/cmdutils.c b/cmdutils.c index 2329120c57..6746be143f 100644 --- a/cmdutils.c +++ b/cmdutils.c @@ -166,7 +166,7 @@ static const OptionDef *find_option(const OptionDef *po, const char *name) return po; } -#if defined(_WIN32) && !defined(__MINGW32CE__) +#if HAVE_COMMANDLINETOARGVW #include #include /* Will be leaked on exit */ @@ -226,7 +226,7 @@ static inline void prepare_app_arguments(int *argc_ptr, char ***argv_ptr) { /* nothing to do */ } -#endif /* WIN32 && !__MINGW32CE__ */ +#endif /* HAVE_COMMANDLINETOARGVW */ int parse_option(void *optctx, const char *opt, const char *arg, const OptionDef *options) diff --git a/configure b/configure index ca11a85553..5e1be338b3 100755 --- a/configure +++ b/configure @@ -1181,6 +1181,7 @@ HAVE_LIST=" attribute_packed closesocket cmov + CommandLineToArgvW cpunop CryptGenRandom dcbzl From 15816c8e8bd5ab2f027824ea5122d7901633634a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Storsj=C3=B6?= Date: Thu, 29 Nov 2012 17:02:42 +0200 Subject: [PATCH 2/2] avutil: Include io.h with a separate condition from MapViewOfFile MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The existence of MapViewOfFile isn't linked to the existence of io.h. Not all versions of windows have MapViewOfFile (in particular, Windows Phone 8 and the "metro" windows 8 API subset don't), while they still have io.h (and need it for open/read/close). Signed-off-by: Martin Storsjö --- libavutil/file.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libavutil/file.c b/libavutil/file.c index 41bd0ddf58..ce02487f35 100644 --- a/libavutil/file.c +++ b/libavutil/file.c @@ -25,10 +25,12 @@ #if HAVE_UNISTD_H #include #endif +#if HAVE_IO_H +#include +#endif #if HAVE_MMAP #include #elif HAVE_MAPVIEWOFFILE -#include #include #endif