From 8369c55edb8faddd292a6fab73f02585cc1b238a Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Wed, 7 May 2025 14:47:26 +0300 Subject: [PATCH] [WINE] wine/asm.h: add missing __ASM_DEFINE_IMPORT --- sdk/include/reactos/wine/asm.h | 42 ++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/sdk/include/reactos/wine/asm.h b/sdk/include/reactos/wine/asm.h index 19a770fcf3b..f3e434a6615 100644 --- a/sdk/include/reactos/wine/asm.h +++ b/sdk/include/reactos/wine/asm.h @@ -78,6 +78,48 @@ #define __ASM_GLOBAL_FUNC(name,code) __ASM_DEFINE_FUNC(__ASM_NAME(#name),code) +/* import variables */ + +#ifdef __WINE_PE_BUILD +# ifdef __arm64ec__ +# define __ASM_DEFINE_IMPORT(name) \ + asm( ".data\n\t" \ + ".balign 8\n\t" \ + ".globl __imp_" name "\n" \ + "__imp_" name ":\n\t" \ + ".quad \"#" name "\"\n\t" \ + ".globl __imp_aux_" name "\n" \ + "__imp_aux_" name ":\n\t" \ + ".quad " name "\n\t" \ + ".text" ); +# elif defined(_WIN64) +# define __ASM_DEFINE_IMPORT(name) \ + __ASM_BLOCK_BEGIN(__LINE__) \ + asm( ".data\n\t" \ + ".balign 8\n\t" \ + ".globl __imp_" name "\n" \ + "__imp_" name ":\n\t" \ + ".quad " name "\n\t" \ + ".text"); \ + __ASM_BLOCK_END +# else +# define __ASM_DEFINE_IMPORT(name) \ + __ASM_BLOCK_BEGIN(__LINE__) \ + asm( ".data\n\t" \ + ".balign 4\n\t" \ + ".globl __imp_" name "\n" \ + "__imp_" name ":\n\t" \ + ".long " name "\n\t" \ + ".text"); \ + __ASM_BLOCK_END +# endif +# define __ASM_GLOBAL_IMPORT(name) __ASM_DEFINE_IMPORT(__ASM_NAME(#name)) +#else +# define __ASM_GLOBAL_IMPORT(name) /* nothing */ +#endif + +/* stdcall support */ + #define __ASM_STDCALL_FUNC(name,args,code) __ASM_DEFINE_FUNC(__ASM_STDCALL(#name,args),code) /* fastcall support */