Alexandre Julliard : include: Update stdcall and cdecl definitions in crtdefs.h.

Alexandre Julliard julliard at wine.codeweavers.com
Fri Jan 29 09:10:08 CST 2016


Module: wine
Branch: master
Commit: 206e8b147bc8670621d8dfaaa03834fb1fc02082
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=206e8b147bc8670621d8dfaaa03834fb1fc02082

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Fri Jan 29 18:05:46 2016 +0900

include: Update stdcall and cdecl definitions in crtdefs.h.

Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 include/msvcrt/crtdefs.h | 20 ++++++++++++++------
 1 file changed, 14 insertions(+), 6 deletions(-)

diff --git a/include/msvcrt/crtdefs.h b/include/msvcrt/crtdefs.h
index f2600ad..dde5ea1 100644
--- a/include/msvcrt/crtdefs.h
+++ b/include/msvcrt/crtdefs.h
@@ -44,7 +44,7 @@
 #ifndef __stdcall
 # ifdef __i386__
 #  ifdef __GNUC__
-#   ifdef __APPLE__ /* Mac OS X uses a 16-byte aligned stack and not a 4-byte one */
+#   if (__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 2)) || defined(__APPLE__)
 #    define __stdcall __attribute__((__stdcall__)) __attribute__((__force_align_arg_pointer__))
 #   else
 #    define __stdcall __attribute__((__stdcall__))
@@ -55,21 +55,29 @@
 #   error You need to define __stdcall for your compiler
 #  endif
 # elif defined(__x86_64__) && defined (__GNUC__)
-#  define __stdcall __attribute__((ms_abi))
-# else
+#  if (__GNUC__ > 5) || ((__GNUC__ == 5) && (__GNUC_MINOR__ >= 3))
+#   define __stdcall __attribute__((ms_abi)) __attribute__((__force_align_arg_pointer__))
+#  else
+#   define __stdcall __attribute__((ms_abi))
+#  endif
+# else  /* __i386__ */
 #  define __stdcall
-# endif
+# endif  /* __i386__ */
 #endif /* __stdcall */
 
 #ifndef __cdecl
 # if defined(__i386__) && defined(__GNUC__)
-#  ifdef __APPLE__ /* Mac OS X uses 16-byte aligned stack and not a 4-byte one */
+#   if (__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 2)) || defined(__APPLE__)
 #   define __cdecl __attribute__((__cdecl__)) __attribute__((__force_align_arg_pointer__))
 #  else
 #   define __cdecl __attribute__((__cdecl__))
 #  endif
 # elif defined(__x86_64__) && defined (__GNUC__)
-#  define __cdecl __attribute__((ms_abi))
+#  if (__GNUC__ > 5) || ((__GNUC__ == 5) && (__GNUC_MINOR__ >= 3))
+#   define __cdecl __attribute__((ms_abi)) __attribute__((__force_align_arg_pointer__))
+#  else
+#   define __cdecl __attribute__((ms_abi))
+#  endif
 # elif !defined(_MSC_VER)
 #  define __cdecl
 # endif




More information about the wine-cvs mailing list