From: Johannes Sixt <j.sixt@viscovery.net>
To: Pat Thoyts <patthoyts@googlemail.com>, Frank Li <lznuaa@gmail.com>
Cc: git@vger.kernel.org, msysGit <msysgit@googlegroups.com>
Subject: Re: [msysGit] quick question about __stdcall at run-command.c mingw.c
Date: Mon, 17 Aug 2009 09:52:18 +0200 [thread overview]
Message-ID: <4A890C32.6010507@viscovery.net> (raw)
In-Reply-To: <a5b261830908161703l2296448l698d07d01ae8a6d3@mail.gmail.com>
Pat Thoyts schrieb:
> 2009/8/17 Frank Li <lznuaa@gmail.com>:
>> I am tring to clear VC build patch.
>>
>> I found __stdcall position break MSVC build.
>>
>> static __stdcall unsigned run_thread(void *data)
>>
>> MSVC require __stdcall should be between return type and function name.
>> like
>> static unsigned __stdcall run_thread(void *data)
>>
>> I think msys gcc should support MSVC format.
>>
>> Should I directly change to MSVC format or add _MSC_VER marcro like
>>
>> #if defined(__MINGW32__)
>> static __stdcall unsigned run_thread(void *data)
>> #elif defined(_MSC_VER) /*MSVC must put __stdcall between return value
>> and function*/
>> static unsigned __stdcall run_thread(void *data)
>> #endif
>
> The win32 api prototype used for thread entry functions is declared as
> a DWORD (WINAPI *LPTHREAD_START_ROUTINE)(LPVOID) type in the mingw
> headers and WINAPI as #define WINAPI __stdcall. This is true for the
> MSVC headers as well. So gcc and msvc are happy using the same
> definition for such a function and just "static unsigned long WINAPI
> run_thread(void *)" might well be sensible.
Change the code to
static unsigned __stdcall run_thread(void *data)
The documentation explictly says: "The routine at start_address passed to
_beginthreadex must use the __stdcall calling convention...". So __stdcall
it is.
-- Hannes
next prev parent reply other threads:[~2009-08-17 7:52 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-08-16 23:19 quick question about __stdcall at run-command.c mingw.c Frank Li
2009-08-17 0:03 ` [msysGit] " Pat Thoyts
2009-08-17 7:52 ` Johannes Sixt [this message]
2009-08-17 8:21 ` Johannes Schindelin
2009-08-17 8:43 ` Johannes Sixt
2009-08-17 9:12 ` Johannes Schindelin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4A890C32.6010507@viscovery.net \
--to=j.sixt@viscovery.net \
--cc=git@vger.kernel.org \
--cc=lznuaa@gmail.com \
--cc=msysgit@googlegroups.com \
--cc=patthoyts@googlemail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox