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 AB3C2424FD for ; Tue, 24 May 2022 09:23:14 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 6858E68B53E; Tue, 24 May 2022 12:23:13 +0300 (EEST) Received: from mail8.parnet.fi (mail8.parnet.fi [77.234.108.134]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 748E168B503 for ; Tue, 24 May 2022 12:23:06 +0300 (EEST) Received: from mail9.parnet.fi (mail9.parnet.fi [77.234.108.21]) by mail8.parnet.fi with ESMTP id 24O9N5un020980-24O9N5uo020980; Tue, 24 May 2022 12:23:05 +0300 Received: from foo.martin.st (host-97-187.parnet.fi [77.234.97.187]) by mail9.parnet.fi (Postfix) with ESMTPS id A671AA142D; Tue, 24 May 2022 12:23:05 +0300 (EEST) Date: Tue, 24 May 2022 12:23:05 +0300 (EEST) From: =?ISO-8859-15?Q?Martin_Storsj=F6?= To: FFmpeg development discussions and patches In-Reply-To: <5313aeec0ee25dfe6255d75e37db29e436c906fb.1653381808.git.ffmpegagent@gmail.com> Message-ID: <4ada51e4-2dc8-76a3-31a9-a98f5f3a7d7@martin.st> References: <5313aeec0ee25dfe6255d75e37db29e436c906fb.1653381808.git.ffmpegagent@gmail.com> MIME-Version: 1.0 X-FE-Policy-ID: 3:14:2:SYSTEM Subject: Re: [FFmpeg-devel] [PATCH v5 2/2] avformat/os_support: Support long file names on Windows 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 Cc: softworkz , Hendrik Leppkes 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 Tue, 24 May 2022, softworkz wrote: > From: softworkz > > Signed-off-by: softworkz > --- > libavformat/os_support.h | 16 +++++++++++----- > 1 file changed, 11 insertions(+), 5 deletions(-) > > diff --git a/libavformat/os_support.h b/libavformat/os_support.h > index 5e6b32d2dc..d4c07803a5 100644 > --- a/libavformat/os_support.h > +++ b/libavformat/os_support.h > @@ -49,7 +49,13 @@ > # ifdef stat > # undef stat > # endif > -# define stat _stati64 > +# define stat win32_stat > + > + struct win32_stat > + { > + struct _stati64; > + }; Is it possible to work around this issue by doing "#define stat(a,b)" which only should apply on the function, not to the struct? Then we can't redirect "struct stat" into "struct _stati64" at the same time... A safe way forward could be to switch code to just using "struct ff_stat_struct", and define ff_stat_struct to the name of the struct we exepct to use. It's not pretty, and it affects users which no longer can use the default POSIX stat form of the calls, but it would fix the issue of redirecting the struct and function separately, without needing to know what exactly is in the struct (because we really shouldn't be hardcoding/assuming that). // 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".