From c31bcd7329c4f214264bbafbecd35ace6d9dd8e7 Mon Sep 17 00:00:00 2001 From: mlankhorst Date: Tue, 25 Nov 2008 09:09:47 +0100 Subject: [PATCH] includes: Add win64 calling convention --- include/msvcrt/process.h | 3 +++ include/windef.h | 8 ++++++++ 2 files changed, 11 insertions(+), 0 deletions(-) diff --git a/include/msvcrt/process.h b/include/msvcrt/process.h index 92cbd22..2c122a6 100644 --- a/include/msvcrt/process.h +++ b/include/msvcrt/process.h @@ -41,6 +41,9 @@ typedef unsigned short wchar_t; # else # error You need to define __stdcall for your compiler # endif +# elif defined(__x86_64__) && defined (__GNUC__) +/* Windows 64 bits has its own specific calling convention */ +# define __stdcall __attribute__((ms_abi)) # else /* __i386__ */ # define __stdcall # endif /* __i386__ */ diff --git a/include/windef.h b/include/windef.h index fd3d423..1a46752 100644 --- a/include/windef.h +++ b/include/windef.h @@ -62,6 +62,9 @@ extern "C" { # else # error You need to define __stdcall for your compiler # endif +# elif defined(__x86_64__) && defined (__GNUC__) +/* Windows 64 bits has its own specific calling convention */ +# define __stdcall __attribute__((ms_abi)) # else /* __i386__ */ # define __stdcall # endif /* __i386__ */ @@ -71,9 +74,14 @@ extern "C" { # if defined(__i386__) && defined(__GNUC__) # ifdef __APPLE__ /* Mac OS X uses 16-byte aligned stack and not a 4-byte one */ # define __cdecl __attribute__((__cdecl__)) __attribute__((__force_align_arg_pointer__)) +# elif defined(__x86_64__) /* Windows 64 bits has its own specific calling convention */ +# define __cdecl __attribute__((ms_abi)) # else # define __cdecl __attribute__((__cdecl__)) # endif +# elif defined(__x86_64__) && defined (__GNUC__) +/* Windows 64 bits has its own specific calling convention */ +# define __cdecl __attribute__((ms_abi)) # elif !defined(_MSC_VER) # define __cdecl # endif -- 1.5.6.5