From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 6239242376 for ; Thu, 14 Apr 2022 08:25:17 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id E7A5068B443; Thu, 14 Apr 2022 11:25:13 +0300 (EEST) Received: from mail8.parnet.fi (mail8.parnet.fi [77.234.108.134]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 3A31968B3B1 for ; Thu, 14 Apr 2022 11:25:07 +0300 (EEST) Received: from mail9.parnet.fi (mail9.parnet.fi [77.234.108.21]) by mail8.parnet.fi with ESMTP id 23E8P5mj024739-23E8P5mk024739 for ; Thu, 14 Apr 2022 11:25:06 +0300 Received: from foo.martin.st (host-97-187.parnet.fi [77.234.97.187]) by mail9.parnet.fi (Postfix) with ESMTPS id E6CE0A1431 for ; Thu, 14 Apr 2022 11:25:05 +0300 (EEST) Date: Thu, 14 Apr 2022 11:25:04 +0300 (EEST) From: =?ISO-8859-15?Q?Martin_Storsj=F6?= To: FFmpeg development discussions and patches In-Reply-To: Message-ID: References: <20220413152142.31981-1-markg85@gmail.com> MIME-Version: 1.0 X-FE-Policy-ID: 3:14:2:SYSTEM Subject: Re: [FFmpeg-devel] [PATCH v1] avformat/ipfsgateway: define PATH_MAX X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 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 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: On Wed, 13 Apr 2022, Mark Gaiser wrote: > On Wed, Apr 13, 2022 at 5:21 PM Mark Gaiser wrote: > >> PATH_MAX is posix. Some compilers (MSVC) don't define this >> thus failing to compile the ipfsgateway file. >> Defining it fixes the compile. >> >> Signed-off-by: Mark Gaiser >> --- >> libavformat/ipfsgateway.c | 6 ++++++ >> 1 file changed, 6 insertions(+) >> >> diff --git a/libavformat/ipfsgateway.c b/libavformat/ipfsgateway.c >> index ed37e552dd..9b0d3dea59 100644 >> --- a/libavformat/ipfsgateway.c >> +++ b/libavformat/ipfsgateway.c >> @@ -25,6 +25,12 @@ >> #include "os_support.h" >> #include "url.h" >> >> +// Define the posix PATH_MAX if not there already. >> +// This fixes a compile issue for MSVC. >> +#ifndef PATH_MAX >> +#define PATH_MAX 4096 >> +#endif >> + >> typedef struct IPFSGatewayContext { >> AVClass *class; >> URLContext *inner; >> -- >> 2.35.1 > > I did verify the size of PATH_MAX. On my pc (arch with GCC compiler) > this value is defined as 4096. That seems enough to me. Another way to > fix this is to add it in os_support.h. I didn't add it there because > ipfsgateway.c is currently the only cross-platform code that makes use > of this. > > Lastly, I don't have an MSVC compiler and windows to test this on. > I hope someone else in that setup can verify that this does indeed fix the > ffmpeg master build? This looks like a reasonable fix to at least make things build correctly again (and it does fix the issue). FWIW, the corresponding Windows define is MAX_PATH, which usually is 260, so setting it to 4096 here is probably more than enough if a hardcoded value is needed. // Martin _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".