wine/asm.h: Introduce __ASM_BLOCK_BEGIN and __ASM_BLOCK_END macros.
Signed-off-by: Jacek Caban <jacek@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
23081e8ebd
commit
541048868d
|
@ -55,16 +55,20 @@
|
||||||
# define __ASM_FUNC_TYPE(name) ".type " name ",@function"
|
# define __ASM_FUNC_TYPE(name) ".type " name ",@function"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __GNUC__
|
#if !defined(__GNUC__) && !defined(__clang__)
|
||||||
# define __ASM_DEFINE_FUNC(name,code) \
|
# define __ASM_BLOCK_BEGIN(name) void __asm_dummy_##name(void) {
|
||||||
asm(".text\n\t.align 4\n\t.globl " name "\n\t" __ASM_FUNC_TYPE(name) __ASM_SEH("\n\t.seh_proc " name) "\n" name ":\n\t" \
|
# define __ASM_BLOCK_END }
|
||||||
__ASM_CFI(".cfi_startproc\n\t") code __ASM_CFI("\n\t.cfi_endproc") __ASM_SEH("\n\t.seh_endproc") );
|
|
||||||
#else
|
#else
|
||||||
# define __ASM_DEFINE_FUNC(name,code) void __asm_dummy_##__LINE__(void) { \
|
# define __ASM_BLOCK_BEGIN(name)
|
||||||
asm(".text\n\t.align 4\n\t.globl " name "\n\t" __ASM_FUNC_TYPE(name) __ASM_SEH("\n\t.seh_proc " name) "\n" name ":\n\t" \
|
# define __ASM_BLOCK_END
|
||||||
__ASM_CFI(".cfi_startproc\n\t") code __ASM_CFI("\n\t.cfi_endproc") __ASM_SEH("\n\t.seh_endproc") ); }
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#define __ASM_DEFINE_FUNC(name,code) \
|
||||||
|
__ASM_BLOCK_BEGIN(__LINE__) \
|
||||||
|
asm(".text\n\t.align 4\n\t.globl " name "\n\t" __ASM_FUNC_TYPE(name) __ASM_SEH("\n\t.seh_proc " name) "\n" name ":\n\t" \
|
||||||
|
__ASM_CFI(".cfi_startproc\n\t") code __ASM_CFI("\n\t.cfi_endproc") __ASM_SEH("\n\t.seh_endproc") ); \
|
||||||
|
__ASM_BLOCK_END
|
||||||
|
|
||||||
#define __ASM_GLOBAL_FUNC(name,code) __ASM_DEFINE_FUNC(__ASM_NAME(#name),code)
|
#define __ASM_GLOBAL_FUNC(name,code) __ASM_DEFINE_FUNC(__ASM_NAME(#name),code)
|
||||||
|
|
||||||
#define __ASM_STDCALL_FUNC(name,args,code) __ASM_DEFINE_FUNC(__ASM_STDCALL(#name,args),code)
|
#define __ASM_STDCALL_FUNC(name,args,code) __ASM_DEFINE_FUNC(__ASM_STDCALL(#name,args),code)
|
||||||
|
|
Loading…
Reference in New Issue