threads / patch / 20674

v2Fix symlink __stdcall problem at MSVC

Subject: [PATCH v2] Fix symlink __stdcall problem at MSVC

## tl;dr

3 messages between Aug 20, 2009 and Aug 21, 2009. Diffs are folded; open one to read it.

replies: 2people: 1as markdown or json

Frank Li· Aug 20, 2009, 14:21 UTC · lore

MSVC requires that __stdcall be between return value and function name. Further, all Win32 API definitions look like this:

	TYPE WINAPI function_name...
Signed-off-by: Frank Li <lznuaa@gmail.com>
---
 compat/mingw.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
Show changes to compat/mingw.c +1 −1
diff --git a/compat/mingw.c b/compat/mingw.c
index fd642e4..4256243 100644
--- a/compat/mingw.c
+++ b/compat/mingw.c
@@ -1421,7 +1421,7 @@ int link(const char *oldpath, const char *newpath)
 
 int symlink(const char *oldpath, const char *newpath)
 {
-	typedef BOOL WINAPI (*symlink_fn)(const char*, const char*, DWORD);
+	typedef BOOL (WINAPI *symlink_fn)(const char*, const char*, DWORD);
 	static symlink_fn create_symbolic_link = NULL;
 	if (!create_symbolic_link) {
 		create_symbolic_link = (symlink_fn) GetProcAddress(
-- 
1.6.4.msysgit.0
Frank Li· Aug 21, 2009, 02:42 UTC · re: Frank Li · lore

Re: [PATCH v2] Fix symlink __stdcall problem at MSVC

Show 11 quoted lines
>
>  int symlink(const char *oldpath, const char *newpath)
>  {
> -       typedef BOOL WINAPI (*symlink_fn)(const char*, const char*, DWORD);
> +       typedef BOOL (WINAPI *symlink_fn)(const char*, const char*, DWORD);
>        static symlink_fn create_symbolic_link = NULL;
>        if (!create_symbolic_link) {
>                create_symbolic_link = (symlink_fn) GetProcAddress(
> --
> 1.6.4.msysgit.0
>
This is new patch for latest devel branch mingw.c.
Frank Li· Aug 21, 2009, 02:57 UTC · re: Frank Li · lore

Re: [PATCH v2] Fix symlink __stdcall problem at MSVC

Show 11 quoted lines
>
>  int symlink(const char *oldpath, const char *newpath)
>  {
> -       typedef BOOL WINAPI (*symlink_fn)(const char*, const char*, DWORD);
> +       typedef BOOL (WINAPI *symlink_fn)(const char*, const char*, DWORD);
>        static symlink_fn create_symbolic_link = NULL;
>        if (!create_symbolic_link) {
>                create_symbolic_link = (symlink_fn) GetProcAddress(
> --
> 1.6.4.msysgit.0
>
This is new patch for latest devel branch mingw.c.

← back to recent threads