Alexandre Julliard : include: Add support for .seh asm annotations.

Alexandre Julliard julliard at winehq.org
Wed Aug 21 14:39:32 CDT 2019


Module: wine
Branch: master
Commit: f1bd0cadd10d25a793261318112503bf68c8506b
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=f1bd0cadd10d25a793261318112503bf68c8506b

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Wed Aug 21 10:40:24 2019 +0200

include: Add support for .seh asm annotations.

Based on a patch by RĂ©mi Bernon.

Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 include/wine/asm.h | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/include/wine/asm.h b/include/wine/asm.h
index c1a6819..01dfdb1 100644
--- a/include/wine/asm.h
+++ b/include/wine/asm.h
@@ -39,6 +39,12 @@
 # define __ASM_CFI(str)
 #endif
 
+#ifdef __SEH__
+# define __ASM_SEH(str) str
+#else
+# define __ASM_SEH(str)
+#endif
+
 #ifdef _WIN32
 # define __ASM_FUNC_TYPE(name) ".def " name "; .scl 2; .type 32; .endef"
 #elif defined(__APPLE__)
@@ -51,12 +57,12 @@
 
 #ifdef __GNUC__
 # define __ASM_DEFINE_FUNC(name,code) \
-    asm(".text\n\t.align 4\n\t.globl " name "\n\t" __ASM_FUNC_TYPE(name) "\n" name ":\n\t" \
-        __ASM_CFI(".cfi_startproc\n\t") code __ASM_CFI("\n\t.cfi_endproc") );
+    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") );
 #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) "\n" name ":\n\t" \
-        __ASM_CFI(".cfi_startproc\n\t") code __ASM_CFI("\n\t.cfi_endproc") ); }
+    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") ); }
 #endif
 
 #define __ASM_GLOBAL_FUNC(name,code) __ASM_DEFINE_FUNC(__ASM_NAME(#name),code)




More information about the wine-cvs mailing list