{"thread":{"id":"20619","subject":"quick question about __stdcall at run-command.c mingw.c","startedAt":"2009-08-16T23:19:22Z","lastAt":"2009-08-17T09:12:13Z","messageCount":6,"participants":["Frank Li","Pat Thoyts","Johannes Sixt","Johannes Schindelin"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"120800","messageId":"1976ea660908161619x5182762sade051f24fef13db@mail.gmail.com","threadId":"20619","inReplyTo":null,"subject":"quick question about __stdcall at run-command.c mingw.c","fromName":"Frank Li","fromEmail":"lznuaa@gmail.com","sentAt":"2009-08-16T23:19:22Z","receivedAt":"2009-08-16T23:19:22Z","isPatch":false,"sender":{"key":"lznuaa@gmail.com","avatar":"https://avatars.githubusercontent.com/u/40642?v=4"},"body":"\nI am tring to clear VC build patch.\n\nI found __stdcall position break MSVC build.\n\nstatic __stdcall unsigned run_thread(void *data)\n\nMSVC require __stdcall should be between return type and function name.\nlike\nstatic unsigned __stdcall run_thread(void *data)\n\nI think msys gcc should support MSVC format.\n\nShould I directly change to MSVC format or add _MSC_VER marcro like\n\n#if defined(__MINGW32__)\nstatic __stdcall unsigned run_thread(void *data)\n#elif defined(_MSC_VER) /*MSVC must put __stdcall between return value\nand function*/\nstatic unsigned __stdcall run_thread(void *data)\n#endif\n"},{"id":"120806","messageId":"a5b261830908161703l2296448l698d07d01ae8a6d3@mail.gmail.com","threadId":"20619","inReplyTo":"1976ea660908161619x5182762sade051f24fef13db@mail.gmail.com","subject":"Re: [msysGit] quick question about __stdcall at run-command.c mingw.c","fromName":"Pat Thoyts","fromEmail":"patthoyts@googlemail.com","sentAt":"2009-08-17T00:03:13Z","receivedAt":"2009-08-17T00:03:13Z","isPatch":false,"sender":{"key":"patthoyts@googlemail.com","avatar":"https://gravatar.com/avatar/2300f94d9f59174a551dbc71278ac2cb2489f56afda920a57e189ad9de0a3f92?d=mp&s=160"},"body":"2009/8/17 Frank Li <lznuaa@gmail.com>:\n>\n> I am tring to clear VC build patch.\n>\n> I found __stdcall position break MSVC build.\n>\n> static __stdcall unsigned run_thread(void *data)\n>\n> MSVC require __stdcall should be between return type and function name.\n> like\n> static unsigned __stdcall run_thread(void *data)\n>\n> I think msys gcc should support MSVC format.\n>\n> Should I directly change to MSVC format or add _MSC_VER marcro like\n>\n> #if defined(__MINGW32__)\n> static __stdcall unsigned run_thread(void *data)\n> #elif defined(_MSC_VER) /*MSVC must put __stdcall between return value\n> and function*/\n> static unsigned __stdcall run_thread(void *data)\n> #endif\n\nThe win32 api prototype used for thread entry functions is declared as\na DWORD (WINAPI *LPTHREAD_START_ROUTINE)(LPVOID) type in the mingw\nheaders and WINAPI as #define WINAPI __stdcall. This is true for the\nMSVC headers as well. So gcc and msvc are happy using the same\ndefinition for such a function and just \"static unsigned long WINAPI\nrun_thread(void *)\" might well be sensible.\n"},{"id":"120841","messageId":"4A890C32.6010507@viscovery.net","threadId":"20619","inReplyTo":"a5b261830908161703l2296448l698d07d01ae8a6d3@mail.gmail.com","subject":"Re: [msysGit] quick question about __stdcall at run-command.c mingw.c","fromName":"Johannes Sixt","fromEmail":"j.sixt@viscovery.net","sentAt":"2009-08-17T07:52:18Z","receivedAt":"2009-08-17T07:52:18Z","isPatch":false,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Pat Thoyts schrieb:\n> 2009/8/17 Frank Li <lznuaa@gmail.com>:\n>> I am tring to clear VC build patch.\n>>\n>> I found __stdcall position break MSVC build.\n>>\n>> static __stdcall unsigned run_thread(void *data)\n>>\n>> MSVC require __stdcall should be between return type and function name.\n>> like\n>> static unsigned __stdcall run_thread(void *data)\n>>\n>> I think msys gcc should support MSVC format.\n>>\n>> Should I directly change to MSVC format or add _MSC_VER marcro like\n>>\n>> #if defined(__MINGW32__)\n>> static __stdcall unsigned run_thread(void *data)\n>> #elif defined(_MSC_VER) /*MSVC must put __stdcall between return value\n>> and function*/\n>> static unsigned __stdcall run_thread(void *data)\n>> #endif\n> \n> The win32 api prototype used for thread entry functions is declared as\n> a DWORD (WINAPI *LPTHREAD_START_ROUTINE)(LPVOID) type in the mingw\n> headers and WINAPI as #define WINAPI __stdcall. This is true for the\n> MSVC headers as well. So gcc and msvc are happy using the same\n> definition for such a function and just \"static unsigned long WINAPI\n> run_thread(void *)\" might well be sensible.\n\nChange the code to\n\n\tstatic unsigned __stdcall run_thread(void *data)\n\nThe documentation explictly says: \"The routine at start_address passed to\n_beginthreadex must use the __stdcall calling convention...\". So __stdcall\nit is.\n\n-- Hannes\n"},{"id":"120846","messageId":"alpine.DEB.1.00.0908171018490.4991@intel-tinevez-2-302","threadId":"20619","inReplyTo":"4A890C32.6010507@viscovery.net","subject":"Re: [msysGit] quick question about __stdcall at run-command.c mingw.c","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2009-08-17T08:21:43Z","receivedAt":"2009-08-17T08:21:43Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Mon, 17 Aug 2009, Johannes Sixt wrote:\n\n> Pat Thoyts schrieb:\n> > 2009/8/17 Frank Li <lznuaa@gmail.com>:\n> >> I am tring to clear VC build patch.\n> >>\n> >> I found __stdcall position break MSVC build.\n> >>\n> >> static __stdcall unsigned run_thread(void *data)\n> >>\n> >> MSVC require __stdcall should be between return type and function \n> >> name. like static unsigned __stdcall run_thread(void *data)\n> >>\n> >> I think msys gcc should support MSVC format.\n\nI think that it does.\n\nBut it is _your_ duty to check.\n\n> >> Should I directly change to MSVC format or add _MSC_VER marcro like\n> >>\n> >> #if defined(__MINGW32__)\n> >> static __stdcall unsigned run_thread(void *data)\n> >> #elif defined(_MSC_VER) /*MSVC must put __stdcall between return value\n> >> and function*/\n> >> static unsigned __stdcall run_thread(void *data)\n> >> #endif\n\nNoooo! NO _MSC_VER crap in mingw.c.  Really.  I am able to repeat that as \noften as you want me, but I'd prefer not to.\n\n> > The win32 api prototype used for thread entry functions is declared as\n> > a DWORD (WINAPI *LPTHREAD_START_ROUTINE)(LPVOID) type in the mingw\n> > headers and WINAPI as #define WINAPI __stdcall. This is true for the\n> > MSVC headers as well. So gcc and msvc are happy using the same\n> > definition for such a function and just \"static unsigned long WINAPI\n> > run_thread(void *)\" might well be sensible.\n> \n> Change the code to\n> \n> \tstatic unsigned __stdcall run_thread(void *data)\n> \n> The documentation explictly says: \"The routine at start_address passed to\n> _beginthreadex must use the __stdcall calling convention...\". So __stdcall\n> it is.\n\nI could not agree more.\n\nCiao,\nDscho\n"},{"id":"120848","messageId":"4A891840.4050403@viscovery.net","threadId":"20619","inReplyTo":"alpine.DEB.1.00.0908171018490.4991@intel-tinevez-2-302","subject":"Re: [msysGit] quick question about __stdcall at run-command.c mingw.c","fromName":"Johannes Sixt","fromEmail":"j.sixt@viscovery.net","sentAt":"2009-08-17T08:43:44Z","receivedAt":"2009-08-17T08:43:44Z","isPatch":false,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Johannes Schindelin schrieb:\n> On Mon, 17 Aug 2009, Johannes Sixt wrote:\n>> Pat Thoyts schrieb:\n>>> 2009/8/17 Frank Li <lznuaa@gmail.com>:\n>>>> I am tring to clear VC build patch.\n>>>>\n>>>> I found __stdcall position break MSVC build.\n>>>>\n>>>> static __stdcall unsigned run_thread(void *data)\n>>>>\n>>>> MSVC require __stdcall should be between return type and function \n>>>> name. like static unsigned __stdcall run_thread(void *data)\n>>>>\n>>>> I think msys gcc should support MSVC format.\n> \n> I think that it does.\n> \n> But it is _your_ duty to check.\n\nCool down. Asking for \"please could you check whether this works\" *if* you\ndon't have the infrastructure to test it yourself is certainly dutyful enough.\n\nDo you have an Irix, Solaris, HP box on your desk next to your Linux, so\nthat you don't have to ask others to test your patches?\n\n-- Hannes\n"},{"id":"120853","messageId":"alpine.DEB.1.00.0908171109091.4991@intel-tinevez-2-302","threadId":"20619","inReplyTo":"4A891840.4050403@viscovery.net","subject":"Re: [msysGit] quick question about __stdcall at run-command.c mingw.c","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2009-08-17T09:12:13Z","receivedAt":"2009-08-17T09:12:13Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Mon, 17 Aug 2009, Johannes Sixt wrote:\n\n> Johannes Schindelin schrieb:\n> > On Mon, 17 Aug 2009, Johannes Sixt wrote:\n> >> Pat Thoyts schrieb:\n> >>> 2009/8/17 Frank Li <lznuaa@gmail.com>:\n> >>>> I am tring to clear VC build patch.\n> >>>>\n> >>>> I found __stdcall position break MSVC build.\n> >>>>\n> >>>> static __stdcall unsigned run_thread(void *data)\n> >>>>\n> >>>> MSVC require __stdcall should be between return type and function \n> >>>> name. like static unsigned __stdcall run_thread(void *data)\n> >>>>\n> >>>> I think msys gcc should support MSVC format.\n> > \n> > I think that it does.\n> > \n> > But it is _your_ duty to check.\n> \n> Cool down. Asking for \"please could you check whether this works\" *if* \n> you don't have the infrastructure to test it yourself is certainly \n> dutyful enough.\n> \n> Do you have an Irix, Solaris, HP box on your desk next to your Linux, so \n> that you don't have to ask others to test your patches?\n\nThis is Windows.  Frank has Windows.\n\nDownloading msysGit does not incur any cost.  Actually running the whole \nthing from the net installer just takes a little time and a two-digit \nmegabyte download.\n\nI put a lot of work into making this procedure as painless to use (for \nother people, it caused me a lot of pain).  So Frank might just as well \nnot let my effort go to hell.\n\nOf course, Frank could ask one of the few msysGit contributors to try to \ncompile something he prepared, wait for the results and possibly fix \nthings for another round.  This appears as a rather poor use of \neverybody's time, methinks.\n\nCiao,\nDscho\n"}]}