From: Timothy Pearson tpearson@raptorengineering.com
Signed-off-by: André Hentschel nerv@dawncrow.de --- include/msvcrt/corecrt.h | 6 ++++++ include/windef.h | 6 ++++++ 2 files changed, 12 insertions(+)
diff --git a/include/msvcrt/corecrt.h b/include/msvcrt/corecrt.h index bc93de023f2..fcb95b409bd 100644 --- a/include/msvcrt/corecrt.h +++ b/include/msvcrt/corecrt.h @@ -70,6 +70,9 @@ # define __stdcall __attribute__((pcs("aapcs-vfp"))) # elif defined(__aarch64__) && defined (__GNUC__) # define __stdcall __attribute__((ms_abi)) +# elif defined(__powerpc64__) && defined (__GNUC__) && !defined (__clang__) + /* ppc64 relies on long calls being generated for thunks (r2 save / restore) */ +# define __stdcall __attribute__((__longcall__)) # else /* __i386__ */ # define __stdcall # endif /* __i386__ */ @@ -92,6 +95,9 @@ # define __cdecl __attribute__((pcs("aapcs-vfp"))) # elif defined(__aarch64__) && defined (__GNUC__) # define __cdecl __attribute__((ms_abi)) +# elif defined(__powerpc64__) && defined (__GNUC__) && !defined (__clang__) + /* ppc64 relies on long calls being generated for thunks (r2 save / restore) */ +# define __cdecl __attribute__((__longcall__)) # endif #endif /* __cdecl */
diff --git a/include/windef.h b/include/windef.h index 436ac6afd87..962dcabe6c8 100644 --- a/include/windef.h +++ b/include/windef.h @@ -71,6 +71,9 @@ extern "C" { # define __stdcall __attribute__((pcs("aapcs-vfp"))) # elif defined(__aarch64__) && defined (__GNUC__) # define __stdcall __attribute__((ms_abi)) +# elif defined(__powerpc64__) && defined (__GNUC__) && !defined (__clang__) + /* ppc64 relies on long calls being generated for thunks (r2 save / restore) */ +# define __stdcall __attribute__((__longcall__)) # else /* __i386__ */ # define __stdcall # endif /* __i386__ */ @@ -93,6 +96,9 @@ extern "C" { # define __cdecl __attribute__((pcs("aapcs-vfp"))) # elif defined(__aarch64__) && defined (__GNUC__) # define __cdecl __attribute__((ms_abi)) +# elif defined(__powerpc64__) && defined (__GNUC__) && !defined (__clang__) + /* ppc64 relies on long calls being generated for thunks (r2 save / restore) */ +# define __cdecl __attribute__((__longcall__)) # elif !defined(_MSC_VER) # define __cdecl # endif