From patchwork Tue Aug 30 07:31:53 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tobias Rapp X-Patchwork-Id: 331 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.140.134 with SMTP id o128csp2099150vsd; Tue, 30 Aug 2016 01:09:03 -0700 (PDT) X-Received: by 10.194.238.42 with SMTP id vh10mr2144353wjc.111.1472544543240; Tue, 30 Aug 2016 01:09:03 -0700 (PDT) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id 131si16414533wma.114.2016.08.30.01.09.01; Tue, 30 Aug 2016 01:09:03 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id A318D689C0C; Tue, 30 Aug 2016 11:08:54 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from p1002.netstorage.at (p1002.netstorage.at [89.207.146.186]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id E2AD1689B1D for ; Tue, 30 Aug 2016 10:31:49 +0300 (EEST) Received: from mailix (noaport.de [46.237.252.213]) by p1002.netstorage.at (Postfix) with ESMTPA id 238A4827C6 for ; Tue, 30 Aug 2016 09:31:54 +0200 (CEST) Received: from [127.0.0.1] (HSI-KBW-46-237-252-214.hsi.kabel-badenwuerttemberg.de [46.237.252.214]) by mailix ; Tue, 30 Aug 2016 09:31:54 +0200 To: ffmpeg-devel@ffmpeg.org References: <7ab2e01e-40ea-9113-fb1e-ce3bec351129@noa-archive.com> <739f2032-c7c9-f3a2-5019-1745fc5581ef@gmail.com> From: Tobias Rapp Organization: NOA GmbH Message-ID: <7e0b9739-a039-eb34-ce34-730563ed47e6@noa-archive.com> Date: Tue, 30 Aug 2016 09:31:53 +0200 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <739f2032-c7c9-f3a2-5019-1745fc5581ef@gmail.com> X-PPP-Message-ID: <20160830073154.19490.7882@p1002.netstorage.at> X-PPP-Vhost: noa-archive.com Subject: Re: [FFmpeg-devel] [PATCH] cmdutils: fix implicit declaration of SetDllDirectory function 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" On 30.08.2016 04:10, James Almer wrote: > On 8/29/2016 10:42 AM, Tobias Rapp wrote: >> Attached patch fixes a build error on my system (Ubuntu 14.04, >> mingw-w64 3.1.0, gcc-mingw-w64 4.8.2) introduced by commit >> 3bf142c77337814458ed8e036796934032d9837f. > > Interesting. windows.h is already included if CommandLineToArgvW() is > available. I guess this means old mingw-w64 doesn't define it. HAVE_COMMANDLINETOARGVW is set to "1" in config.h on my system, but the include of windows.h for CommandLineToArgvW() is on line 228 while SetDllDirectory() is used on line 118. Attached patch is a suggestion to refactor the includes by moving the include of shellapi.h to the top of the file. >> As the original commit has been backported to older releases (2.8, >> 3.0 and 3.1 as far as I can see) it probably makes sense to >> backport this fix, too. > > Applied where it's needed. Thanks. Regards, Tobias From 5d1cbec583647b5023589afba3f5095583d7ccd6 Mon Sep 17 00:00:00 2001 From: Tobias Rapp Date: Tue, 30 Aug 2016 09:19:04 +0200 Subject: [PATCH] cmdutils: move includes to top of file Signed-off-by: Tobias Rapp --- cmdutils.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cmdutils.c b/cmdutils.c index 44f44cd..cc27c63 100644 --- a/cmdutils.c +++ b/cmdutils.c @@ -64,6 +64,9 @@ #ifdef _WIN32 #include #endif +#if HAVE_COMMANDLINETOARGVW +#include +#endif static int init_report(const char *env); @@ -225,8 +228,6 @@ static const OptionDef *find_option(const OptionDef *po, const char *name) * by default. HAVE_COMMANDLINETOARGVW is true on cygwin, while * it doesn't provide the actual command line via GetCommandLineW(). */ #if HAVE_COMMANDLINETOARGVW && defined(_WIN32) -#include -#include /* Will be leaked on exit */ static char** win32_argv_utf8 = NULL; static int win32_argc = 0; -- 1.9.1