From patchwork Tue Dec 10 20:08:48 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Martin_Storsj=C3=B6?= X-Patchwork-Id: 16703 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id 3EB424481B1 for ; Tue, 10 Dec 2019 22:14:25 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 1781E68AEC5; Tue, 10 Dec 2019 22:14:25 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-lj1-f175.google.com (mail-lj1-f175.google.com [209.85.208.175]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id AE17568A7C7 for ; Tue, 10 Dec 2019 22:14:18 +0200 (EET) Received: by mail-lj1-f175.google.com with SMTP id j6so21375646lja.2 for ; Tue, 10 Dec 2019 12:14:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=martin-st.20150623.gappssmtp.com; s=20150623; h=from:to:subject:date:message-id; bh=DAFZMPYqmr7WxtMqpaA8WGBieVKR/aM5flNJqKVUjbs=; b=IdAC3ABNqG0xWGp9r+Os/Xkr+mbRN9LYo7LR+9kilRiSVBQbCifK13C3L4pGSyDmQU vkTUpu0vGqrzN0znpAMXWylLvhnvv/FT0nQeD3CcImmlnf8Iy0iYOiiIixqvr+1NIUVh h3Iqc4uW44ZVqBsWZE2n1g3E+xv8+cjBIMSLFyyiK+IcDDs+v7WLLO9WkEhE9XgspyZ/ CMvDb3gUUXx6BVvTUx9zrR/jM7+ZAAjpqsrEHqLW6UiTNgUc0WeoNqNgwEdfY0atEYdM XCIaFMewxQUuYJY4R885YXCPxCOhY4NgAq6Tv+RpyidCs1g6Nv2XBBcgcvLaLQkggGXN XyYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id; bh=DAFZMPYqmr7WxtMqpaA8WGBieVKR/aM5flNJqKVUjbs=; b=AKh9lzDaodQglpXm3TWRKMbdDQje6B93rtC5sjKg8rjxI0NbANlXT+kKDvZ4SKL+FJ JOecGOIT4zB1zZTTMd+iXrAwKO/hv7XAWGkO5OwurTpbiXzBdwYW/va8xYiykajNknq5 OHmyQYgjm1Xe5J1Ose1tV/obVtNeic59QNkqNfcMTlQNI1hmGDSFaOzN9lru6Eer1hAX CYe7CjEYDoFiqfLSUj+BCErOes4qJTzExUt5JqV+tvFqdgTdXqsZWV6AcXmHoUOFY+Bi U26dCqq+dcRrV9wW/Y/RScMXa33CQL+5YTKXT+62V8Jb6V4x003dxX6xo9NhO1rDok7q ITQQ== X-Gm-Message-State: APjAAAV+i8liqf3DyIuHB0+vaJVHCg8Fff1s4OXfGRt4TFux3AyHT2es 6h4u2bVspRdk+dLPWQtrcnyPoiILMl0= X-Google-Smtp-Source: APXvYqwumPqqAFs4t3Zf8ohrQwsTLzQo7tqYztWmzhFa9cPwtbjtdCfTttNna6IZyj8HGa7cMHX7ug== X-Received: by 2002:a2e:a163:: with SMTP id u3mr13653183ljl.13.1576008529688; Tue, 10 Dec 2019 12:08:49 -0800 (PST) Received: from localhost.localdomain (dsl-tkubng21-58c01c-243.dhcp.inet.fi. [88.192.28.243]) by smtp.gmail.com with ESMTPSA id l8sm2329447ljj.96.2019.12.10.12.08.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Dec 2019 12:08:49 -0800 (PST) From: =?UTF-8?q?Martin=20Storsj=C3=B6?= To: ffmpeg-devel@ffmpeg.org Date: Tue, 10 Dec 2019 22:08:48 +0200 Message-Id: <20191210200848.21040-1-martin@martin.st> X-Mailer: git-send-email 2.17.1 Subject: [FFmpeg-devel] [PATCH] configure: Check for the SetDllDirectory and GetModuleHandle functions X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" These functions aren't available when building for the restricted UWP/WinRT/WinStore API subsets. Normally when building in this mode, one is probably only building the libraries, but being able to build ffmpeg.exe still is useful (and a ffmpeg.exe targeting these API subsets still can be run e.g. in wine, for testing). --- configure | 4 ++++ fftools/cmdutils.c | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/configure b/configure index 922cd8d0ee..bb504b144c 100755 --- a/configure +++ b/configure @@ -2196,6 +2196,7 @@ SYSTEM_FUNCS=" getaddrinfo gethrtime getopt + GetModuleHandle GetProcessAffinityMask GetProcessMemoryInfo GetProcessTimes @@ -2225,6 +2226,7 @@ SYSTEM_FUNCS=" SecItemImport SetConsoleTextAttribute SetConsoleCtrlHandler + SetDllDirectory setmode setrlimit Sleep @@ -6035,6 +6037,7 @@ check_func_headers mach/mach_time.h mach_absolute_time check_func_headers stdlib.h getenv check_func_headers sys/stat.h lstat +check_func_headers windows.h GetModuleHandle check_func_headers windows.h GetProcessAffinityMask check_func_headers windows.h GetProcessTimes check_func_headers windows.h GetSystemTimeAsFileTime @@ -6043,6 +6046,7 @@ check_func_headers windows.h MapViewOfFile check_func_headers windows.h PeekNamedPipe check_func_headers windows.h SetConsoleTextAttribute check_func_headers windows.h SetConsoleCtrlHandler +check_func_headers windows.h SetDllDirectory check_func_headers windows.h Sleep check_func_headers windows.h VirtualAlloc check_func_headers glob.h glob diff --git a/fftools/cmdutils.c b/fftools/cmdutils.c index 84f98b7c04..fe903fa4da 100644 --- a/fftools/cmdutils.c +++ b/fftools/cmdutils.c @@ -119,7 +119,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(""); @@ -2039,7 +2039,7 @@ FILE *get_preset_file(char *filename, size_t filename_size, av_strlcpy(filename, preset_name, filename_size); f = fopen(filename, "r"); } else { -#ifdef _WIN32 +#if HAVE_GETMODULEHANDLE char datadir[MAX_PATH], *ls; base[2] = NULL;