git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 05/14] Fix __stdcall placement and function prototype

From
Marius Storm-Olsen <mstormo@gmail.com>
Date
Sep 15, 2009, 13:44 UTC
Message-ID
<8368a0b347c01e7ddb5e5b514a46e55dd6f0daf7.1253021728.git.mstormo@gmail.com>
In-Reply-To
<badc5d24387c28c752a45f75e8aec6bce64f81fe.1253021728.git.mstormo@gmail.com>
From: Frank Li <lznuaa@gmail.com>
MSVC requires __stdcall to be between the functions return value and
the function name, and that the function pointer type is in the form
of
    return_type (WINAPI *function_name)(arguments...)
Signed-off-by: Frank Li <lznuaa@gmail.com>
Signed-off-by: Marius Storm-Olsen <mstormo@gmail.com>
---
 compat/mingw.c |    4 ++--
 run-command.c  |    2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/compat/mingw.c b/compat/mingw.c
index 5a8fae8..34ee427 100644
--- a/compat/mingw.c
+++ b/compat/mingw.c
@@ -1027,7 +1027,7 @@ static sig_handler_t timer_fn = SIG_DFL;
  * length to call the signal handler.
  */
 
-static __stdcall unsigned ticktack(void *dummy)
+static unsigned __stdcall ticktack(void *dummy)
 {
 	while (WaitForSingleObject(timer_event, timer_interval) == WAIT_TIMEOUT) {
 		if (timer_fn == SIG_DFL)
@@ -1154,7 +1154,7 @@ void mingw_open_html(const char *unixpath)
 
 int link(const char *oldpath, const char *newpath)
 {
-	typedef BOOL WINAPI (*T)(const char*, const char*, LPSECURITY_ATTRIBUTES);
+	typedef BOOL (WINAPI *T)(const char*, const char*, LPSECURITY_ATTRIBUTES);
 	static T create_hard_link = NULL;
 	if (!create_hard_link) {
 		create_hard_link = (T) GetProcAddress(
diff --git a/run-command.c b/run-command.c
index 02aaedf..bb76750 100644
--- a/run-command.c
+++ b/run-command.c
@@ -316,7 +316,7 @@ int run_command_v_opt_cd_env(const char **argv, int opt, const char *dir, const
 }
 
 #ifdef __MINGW32__
-static __stdcall unsigned run_thread(void *data)
+static unsigned __stdcall run_thread(void *data)
 {
 	struct async *async = data;
 	return async->proc(async->fd_for_proc, async->data);
-- 
1.6.2.1.418.g33d56.dirty
Previous: Marius Storm-OlsenNext: Marius Storm-Olsen
Message 6 of 21 in “Build Git with MSVC”
  1. 00/14 Build Git with MSVCMarius Storm-Olsen, Sep 15, 2009
  2. 01/14 Avoid declaration after statementMarius Storm-Olsen, Sep 15, 2009
  3. 02/14 Add define guards to compat/win32.hMarius Storm-Olsen, Sep 15, 2009
  4. 03/14 Change regerror() declaration from K&R style to ANSI C (C89)Marius Storm-Olsen, Sep 15, 2009
  5. 04/14 Set _O_BINARY as default fmode for both MinGW and MSVCMarius Storm-Olsen, Sep 15, 2009
  6. 05/14 Fix __stdcall placement and function prototypeMarius Storm-Olsen, Sep 15, 2009
  7. 06/14 Test for WIN32 instead of __MINGW32_Marius Storm-Olsen, Sep 15, 2009
  8. 07/14 Add empty header files for MSVC portMarius Storm-Olsen, Sep 15, 2009
  9. 08/14 Add MinGW header files to build git with MSVCMarius Storm-Olsen, Sep 15, 2009
  10. 09/14 Add platform files for MSVC portingMarius Storm-Olsen, Sep 15, 2009
  11. 10/14 Make usage of windows.h lean and meanMarius Storm-Olsen, Sep 15, 2009
  12. 11/14 Define strncasecmp and ftruncate for MSVCMarius Storm-Olsen, Sep 15, 2009
  13. 12/14 Add MSVC to MakefileMarius Storm-Olsen, Sep 15, 2009
  14. 13/14 Add README for MSVC buildMarius Storm-Olsen, Sep 15, 2009
  15. 14/14 Add scripts to generate projects for other buildsystems (MSVC vcproj, QMake)Marius Storm-Olsen, Sep 15, 2009
  16. Thiago FarinaSep 16, 2009
  17. Marius Storm-OlsenSep 16, 2009
  18. Alexey BorzenkovSep 15, 2009
  19. Alexey BorzenkovSep 15, 2009
  20. Alexey BorzenkovSep 15, 2009
  21. Marius Storm-OlsenSep 15, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.