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"
|
||||
#endif
|
||||
|
||||
#ifdef __GNUC__
|
||||
# define __ASM_DEFINE_FUNC(name,code) \
|
||||
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") );
|
||||
#if !defined(__GNUC__) && !defined(__clang__)
|
||||
# define __ASM_BLOCK_BEGIN(name) void __asm_dummy_##name(void) {
|
||||
# define __ASM_BLOCK_END }
|
||||
#else
|
||||
# define __ASM_DEFINE_FUNC(name,code) void __asm_dummy_##__LINE__(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" \
|
||||
__ASM_CFI(".cfi_startproc\n\t") code __ASM_CFI("\n\t.cfi_endproc") __ASM_SEH("\n\t.seh_endproc") ); }
|
||||
# define __ASM_BLOCK_BEGIN(name)
|
||||
# define __ASM_BLOCK_END
|
||||
#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_STDCALL_FUNC(name,args,code) __ASM_DEFINE_FUNC(__ASM_STDCALL(#name,args),code)
|
||||
|
|
Loading…
Reference in New Issue