From: Erik Faye-Lund Date: Wed, 04 Nov 2009 21:41:42 GMT Subject: Re: [PATCH] MSVC: Windows-native implementation for subset of Pthreads API Message-ID: <40aa078e0911041341s1adbbf31t6961207ba9c7905b@mail.gmail.com> In-Reply-To: <16cee31f0911041316n20fc9f12s6595dadc813d8f46@mail.gmail.com> On Wed, Nov 4, 2009 at 10:16 PM, Andrzej K. Haczewski wrote: >>> +static THREAD_RET_TYPE threaded_find_deltas(void *arg) >> >> Why can't you just cast the function pointer in your pthread_create >> wrapper instead?  No one cares about the returned value anyway. > > Because of calling convention - I'd have to cast cdecl function as > stdcall function, which would change the function call clean up (in > cdecl caller is responsible for unwinding stack, stdcall callee; the > effect - double stack unwinding). > Couldn't the windows version of pthread_create have a wrapper function, that corrected the calling convention, much like the function run_thread that start_async in run-command.c has? -- Erik "kusma" Faye-Lund