[PATCH] include: Check whether the ms_abi attribute is supported on aarch64.
Kevin Puetz
PuetzKevinA at JohnDeere.com
Mon Jan 4 11:19:39 CST 2021
Updated to maintain sync with dac1e16dd4edc8404c59dc63ae708cd8bb50a38a
Signed-off-by: Kevin Puetz <PuetzKevinA at JohnDeere.com>
---
These wine-specific headers aren't used in mingw, but neither was corecrt.h
It seems that the intent was for all of these (re-)definitions to match.
For context, we're building some winelib code on aarch64, in an embedded
toolchain that does not support ms_abi/__builtin_ms_va_list, which is OK
OK since everything is compiled that way.
So we we've been previously patching headers to remove ms_abi
(this was obviously not something suitable to submit upstream).
But if windef.h and corecrt.h now check __has_attribute(ms_abi),
these hunks seem to logcally go with that too.
---
include/wine/debug.h | 2 +-
include/wine/test.h | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/include/wine/debug.h b/include/wine/debug.h
index e064aaefb8e3..2255f62e502c 100644
--- a/include/wine/debug.h
+++ b/include/wine/debug.h
@@ -157,7 +157,7 @@ extern int __cdecl __wine_dbg_header( enum __wine_debug_class cls, struct __wine
quotes. The string will be valid for some time, but not indefinitely
as strings are re-used. */
-#if (defined(__x86_64__) || defined(__aarch64__)) && defined(__GNUC__) && defined(__WINE_USE_MSVCRT)
+#if (defined(__x86_64__) || (defined(__aarch64__) && __has_attribute(ms_abi))) && defined(__GNUC__) && defined(__WINE_USE_MSVCRT)
# define __wine_dbg_cdecl __cdecl
# define __wine_dbg_va_list __builtin_ms_va_list
# define __wine_dbg_va_start(list,arg) __builtin_ms_va_start(list,arg)
diff --git a/include/wine/test.h b/include/wine/test.h
index 38c8922458e4..787fea0ba249 100644
--- a/include/wine/test.h
+++ b/include/wine/test.h
@@ -78,7 +78,7 @@ extern void winetest_wait_child_process( HANDLE process );
#define START_TEST(name) void func_##name(void)
#endif
-#if (defined(__x86_64__) || defined(__aarch64__)) && defined(__GNUC__) && defined(__WINE_USE_MSVCRT)
+#if (defined(__x86_64__) || (defined(__aarch64__) && __has_attribute(ms_abi))) && defined(__GNUC__) && defined(__WINE_USE_MSVCRT)
#define __winetest_cdecl __cdecl
#define __winetest_va_list __builtin_ms_va_list
#else
More information about the wine-devel
mailing list