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 E530D4318F for ; Tue, 24 May 2022 12:12:09 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 1EB5168B504; Tue, 24 May 2022 15:12:06 +0300 (EEST) Received: from msg-6.mailo.com (ip-16.mailobj.net [213.182.54.16]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 3333468B19D for ; Tue, 24 May 2022 15:12:00 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=mailo.com; s=mailo; t=1653394319; bh=M4Erb/kVvi+H49zB4X40SdJKc3fE/Wiq/xydW9Zwix0=; h=X-EA-Auth:From:To:Date:Subject:MIME-Version:X-Mailer:Message-ID: In-Reply-To:Content-Type:Content-Transfer-Encoding; b=bFrfeL+kEnyB10mCAfgojjV3pYpSpvJ0UDrCAurc4F2krQ1pdQ71z7XcBSgSFdwvz 9GbLF37z30gmEEh0kwKD6nPEPbcVHHafOpW4Nr+i+W3Fn9WzXONkP4w04oxKtGswEV lhAVGIM9GbvaEwKMuCWRiteq9sPpZD719JZJFeXw= Received: by www-7.mailo.com with http webmail; Tue, 24 May 2022 14:11:59 +0200 (CEST) X-EA-Auth: nUb51+mfD+L/VH85OmMO78jqVdWiLpzpHZfqY2ZVqMiBHRLJxwakSAtqK4nmLVcOGkpUAtpfnoNICc7kFReeqVugJQV4is+s From: nil-admirari@mailo.com To: ffmpeg-devel@ffmpeg.org Date: Tue, 24 May 2022 14:11:59 +0200 (CEST) X-Priority: 3 MIME-Version: 1.0 X-Mailer: COMS/EA21.01/r20220415 Message-ID: In-Reply-To: Subject: Re: [FFmpeg-devel] [PATCH v2 1/2] avutil/wchar_filename, file_open: 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 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: > If we would > want to get rid of this, we could define the struct as follows: > > struct win32_stat > { > union > { > struct _stati64; > struct _stati64 stat; > }; > }; > > The union is anonymous and includes _stati64 twice: once anonymous > and once named. > > This would allow us to define our win32_stat function like this: > > static inline int win32_stat(const char *filename_utf8, struct win32_stat *par) > { > wchar_t *filename_w; > int ret; > if (get_extended_win32_path(filename_utf8, &filename_w)) > return -1; > if (!filename_w) > goto fallback; > ret = _wstat64(filename_w, &par->stat); > av_free(filename_w); > return ret; > fallback: > return _stat64(filename_utf8, &par->stat); > } > > so it uses the ->stat member for doing the api calls while > the calling (ffmpeg) code can use the structure as if it was the > actual POSIX stat structure. I'm fine with anonymous union and a rewrite of win32_stat. But, anonymous unions are a C11 feature: https://en.cppreference.com/w/c/language/union, and C11 is apparently not allowed https://ffmpeg.org/developer.html#C-language-features. _______________________________________________ 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".