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 0882D46B37 for ; Fri, 4 Aug 2023 11:40:26 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id DEF2A68C710; Fri, 4 Aug 2023 14:40:24 +0300 (EEST) Received: from mail8.parnet.fi (mail8.parnet.fi [77.234.108.134]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id CFED368C574 for ; Fri, 4 Aug 2023 14:40:17 +0300 (EEST) Received: from mail9.parnet.fi (mail9.parnet.fi [77.234.108.21]) by mail8.parnet.fi with ESMTP id 374BeHgj007248-374BeHgk007248 for ; Fri, 4 Aug 2023 14:40:17 +0300 Received: from foo.martin.st (host-97-144.parnet.fi [77.234.97.144]) by mail9.parnet.fi (Postfix) with ESMTPS id 2DE3AA146D for ; Fri, 4 Aug 2023 14:40:17 +0300 (EEST) Date: Fri, 4 Aug 2023 14:40:17 +0300 (EEST) From: =?ISO-8859-15?Q?Martin_Storsj=F6?= To: ffmpeg-devel@ffmpeg.org In-Reply-To: <20230802070301.31623-1-martin@martin.st> Message-ID: References: <20230802070301.31623-1-martin@martin.st> MIME-Version: 1.0 X-FE-Policy-ID: 3:14:2:SYSTEM X-Content-Filtered-By: Mailman/MimeDel 2.1.29 Subject: Re: [FFmpeg-devel] [PATCH] w32pthreads: Fix function signature mismatches for CreateThread 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: quoted-printable Content-Type: text/plain; charset="iso-8859-15"; Format="flowed" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: On Wed, 2 Aug 2023, Martin Storsj=F6 wrote: > In WinRT mode, we use CreateThread instead of _beginthreadex. > > CreateThread takes a LPTHREAD_START_ROUTINE function pointer, > which has got the signature DWORD WINAPI ThreadProc(LPVOID). > _beginthreadex takes a function with the signature > unsigned __stdcall func(void *). > > DWORD is defined as an unsigned long, which is different type > from unsigned int, even if they have the same size on Windows. > > This fixes build failures with Clang 16 and newer, where function > pointer type mismatches are a fatal error by default. > --- > compat/w32pthreads.h | 9 ++++++++- > 1 file changed, 8 insertions(+), 1 deletion(-) > > diff --git a/compat/w32pthreads.h b/compat/w32pthreads.h > index 6405e72b64..dae8d9420d 100644 > --- a/compat/w32pthreads.h > +++ b/compat/w32pthreads.h > @@ -66,7 +66,14 @@ typedef CONDITION_VARIABLE pthread_cond_t; > #define PTHREAD_CANCEL_ENABLE 1 > #define PTHREAD_CANCEL_DISABLE 0 > > -static av_unused unsigned __stdcall attribute_align_arg win32thread_work= er(void *arg) > +#if HAVE_WINRT > +#define THREADFUNC_RETTYPE DWORD > +#else > +#define THREADFUNC_RETTYPE unsigned > +#endif > + > +static av_unused THREADFUNC_RETTYPE > +__stdcall attribute_align_arg win32thread_worker(void *arg) > { > pthread_t *h =3D (pthread_t*)arg; > h->ret =3D h->func(h->arg); > -- = > 2.34.1 Will push soon if there's no objections, as this is rather trivial. // 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".