From afcede09b658f00182cc42a491a279b516ec5358 Mon Sep 17 00:00:00 2001 From: James Almer Date: Mon, 22 Aug 2016 19:24:31 -0300 Subject: [PATCH] cmdutils: check for SetDllDirectory() availability It's only available on Windows XP or newer. Should fix compilation with mingw32 using the default OS target. Reviewed-by: Michael Niedermayer Signed-off-by: James Almer --- cmdutils.c | 2 +- configure | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/cmdutils.c b/cmdutils.c index 01bc82ce98..06c696b7f7 100644 --- a/cmdutils.c +++ b/cmdutils.c @@ -113,7 +113,7 @@ static void log_callback_report(void *ptr, int level, const char *fmt, va_list v void init_dynload(void) { -#ifdef _WIN32 +#if HAVE_SETDLLDIRECTORY /* Calling SetDllDirectory with the empty string (but not NULL) removes the * current working directory from the DLL search path as a security pre-caution. */ SetDllDirectory(""); diff --git a/configure b/configure index c35f67c685..3559ea1506 100755 --- a/configure +++ b/configure @@ -1728,6 +1728,7 @@ SYSTEM_FUNCS=" pthread_cancel sched_getaffinity SetConsoleTextAttribute + SetDllDirectory setmode setrlimit Sleep @@ -4708,6 +4709,7 @@ check_func_headers windows.h GetSystemTimeAsFileTime check_func_headers windows.h MapViewOfFile check_func_headers windows.h PeekNamedPipe check_func_headers windows.h SetConsoleTextAttribute +check_func_headers windows.h SetDllDirectory check_func_headers windows.h Sleep check_func_headers windows.h VirtualAlloc check_func_headers glob.h glob