From d5a7d08f636c9c499771203ad2d368f4379ca6b2 Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Wed, 13 Oct 2021 21:13:27 +0200 Subject: [PATCH] include: Add a define to enable fastcall wrappers, similar to the thiscall one. Signed-off-by: Alexandre Julliard --- dlls/hal/hal.c | 6 +++--- dlls/hidclass.sys/pnp.c | 2 +- dlls/winebus.sys/main.c | 2 +- dlls/wineusb.sys/wineusb.c | 2 +- dlls/winexinput.sys/main.c | 2 +- include/wine/asm.h | 3 ++- 6 files changed, 9 insertions(+), 8 deletions(-) diff --git a/dlls/hal/hal.c b/dlls/hal/hal.c index 21ce6e12c99..55a8891b6fa 100644 --- a/dlls/hal/hal.c +++ b/dlls/hal/hal.c @@ -34,7 +34,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(ntoskrnl); #ifdef __i386__ -#ifndef _WIN32 +#ifdef __ASM_USE_FASTCALL_WRAPPER extern void * WINAPI wrap_fastcall_func1( void *func, const void *a ); __ASM_STDCALL_FUNC( wrap_fastcall_func1, 8, @@ -53,12 +53,12 @@ __ASM_STDCALL_FUNC( wrap_fastcall_func2, 12, #define call_fastcall_func1(func,a) wrap_fastcall_func1(func,a) #define call_fastcall_func2(func,a,b) wrap_fastcall_func2(func,a,b) -#else /* _WIN32 */ +#else /* __ASM_USE_FASTCALL_WRAPPER */ #define call_fastcall_func1(func,a) func(a) #define call_fastcall_func2(func,a,b) func(a,b) -#endif /* _WIN32 */ +#endif /* __ASM_USE_FASTCALL_WRAPPER */ DEFINE_FASTCALL1_WRAPPER( ExAcquireFastMutex ) void FASTCALL ExAcquireFastMutex( FAST_MUTEX *mutex ) diff --git a/dlls/hidclass.sys/pnp.c b/dlls/hidclass.sys/pnp.c index dbf04c0a403..6dafa1b95af 100644 --- a/dlls/hidclass.sys/pnp.c +++ b/dlls/hidclass.sys/pnp.c @@ -40,7 +40,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(hid); DEFINE_DEVPROPKEY(DEVPROPKEY_HID_HANDLE, 0xbc62e415, 0xf4fe, 0x405c, 0x8e, 0xda, 0x63, 0x6f, 0xb5, 0x9f, 0x08, 0x98, 2); DEFINE_GUID(GUID_DEVINTERFACE_WINEXINPUT, 0x6c53d5fd, 0x6480, 0x440f, 0xb6, 0x18, 0x47, 0x67, 0x50, 0xc5, 0xe1, 0xa6); -#if defined(__i386__) && !defined(_WIN32) +#ifdef __ASM_USE_FASTCALL_WRAPPER extern void * WINAPI wrap_fastcall_func1( void *func, const void *a ); __ASM_STDCALL_FUNC( wrap_fastcall_func1, 8, diff --git a/dlls/winebus.sys/main.c b/dlls/winebus.sys/main.c index 16192977bef..6f44f4c9722 100644 --- a/dlls/winebus.sys/main.c +++ b/dlls/winebus.sys/main.c @@ -343,7 +343,7 @@ static void bus_unlink_hid_device(DEVICE_OBJECT *device) RtlLeaveCriticalSection(&device_list_cs); } -#if defined(__i386__) && !defined(_WIN32) +#ifdef __ASM_USE_FASTCALL_WRAPPER extern void * WINAPI wrap_fastcall_func1(void *func, const void *a); __ASM_STDCALL_FUNC(wrap_fastcall_func1, 8, "popl %ecx\n\t" diff --git a/dlls/wineusb.sys/wineusb.c b/dlls/wineusb.sys/wineusb.c index 085acf77e6f..cca0257bb02 100644 --- a/dlls/wineusb.sys/wineusb.c +++ b/dlls/wineusb.sys/wineusb.c @@ -38,7 +38,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(wineusb); -#if defined(__i386__) && !defined(_WIN32) +#ifdef __ASM_USE_FASTCALL_WRAPPER extern void * WINAPI wrap_fastcall_func1( void *func, const void *a ); __ASM_STDCALL_FUNC( wrap_fastcall_func1, 8, diff --git a/dlls/winexinput.sys/main.c b/dlls/winexinput.sys/main.c index 05d64b05d4f..abc61e8754f 100644 --- a/dlls/winexinput.sys/main.c +++ b/dlls/winexinput.sys/main.c @@ -39,7 +39,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(winexinput); -#if defined(__i386__) && !defined(_WIN32) +#ifdef __ASM_USE_FASTCALL_WRAPPER extern void *WINAPI wrap_fastcall_func1(void *func, const void *a); __ASM_STDCALL_FUNC(wrap_fastcall_func1, 8, "popl %ecx\n\t" diff --git a/include/wine/asm.h b/include/wine/asm.h index 51f04548731..da1d0d803cd 100644 --- a/include/wine/asm.h +++ b/include/wine/asm.h @@ -119,6 +119,7 @@ #if defined(__i386__) && !defined(_WIN32) +# define __ASM_USE_FASTCALL_WRAPPER # define DEFINE_FASTCALL1_WRAPPER(func) \ __ASM_FASTCALL_FUNC( func, 4, \ "popl %eax\n\t" \ @@ -144,7 +145,7 @@ #if defined(__i386__) && !defined(__MINGW32__) && (!defined(_MSC_VER) || !defined(__clang__)) -#define __ASM_USE_THISCALL_WRAPPER +# define __ASM_USE_THISCALL_WRAPPER # ifdef _MSC_VER # define DEFINE_THISCALL_WRAPPER(func,args) \ __declspec(naked) void __thiscall_##func(void) \