[PATCH 07/17] Fix __stdcall/WINAPI placement and function prototype
- From
Marius Storm-Olsen <mstormo@gmail.com>
- Date
- Sep 14, 2009, 13:11 UTC
- Message-ID
- <1d699897d4163224ce22db9400569fab20547e9d.1252925290.git.mstormo@gmail.com>
- In-Reply-To
- <160ceafba5f58cfcadb13380e3d8ef724009b700.1252925290.git.mstormo@gmail.com>
From: Frank Li <lznuaa@gmail.com>
WINAPI is a macro which translates into the proper calling convention, so replace __stdcall with that.
MSVC requires WINAPI 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 12db9a6..90764eb 100644 --- a/compat/mingw.c +++ b/compat/mingw.c @@ -1029,7 +1029,7 @@ static sig_handler_t timer_fn = SIG_DFL; * length to call the signal handler. */ -static __stdcall unsigned ticktack(void *dummy) +static unsigned WINAPI ticktack(void *dummy) { while (WaitForSingleObject(timer_event, timer_interval) == WAIT_TIMEOUT) { if (timer_fn == SIG_DFL) @@ -1156,7 +1156,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..91f6d2e 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 WINAPI run_thread(void *data) { struct async *async = data; return async->proc(async->fd_for_proc, async->data);
-- 1.6.2.1.418.g33d56.dirty