Rémi Bernon : include: Emit assembly function size when compiling without MinGW.
Alexandre Julliard
julliard at winehq.org
Tue Dec 1 15:40:34 CST 2020
Module: wine
Branch: master
Commit: 4130bbf48fdc7d54ec01102de4cb03ccfb105ec0
URL: https://source.winehq.org/git/wine.git/?a=commit;h=4130bbf48fdc7d54ec01102de4cb03ccfb105ec0
Author: Rémi Bernon <rbernon at codeweavers.com>
Date: Mon Nov 30 10:30:19 2020 +0100
include: Emit assembly function size when compiling without MinGW.
Signed-off-by: Rémi Bernon <rbernon at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
include/wine/asm.h | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/include/wine/asm.h b/include/wine/asm.h
index b4b6fb50eb8..b5e6c6efd3d 100644
--- a/include/wine/asm.h
+++ b/include/wine/asm.h
@@ -65,6 +65,14 @@
# define __ASM_FUNC_TYPE(name) ".type " name ", at function"
#endif
+#ifdef _WIN32
+# define __ASM_FUNC_SIZE(name) ""
+#elif defined(__APPLE__)
+# define __ASM_FUNC_SIZE(name) ""
+#else
+# define __ASM_FUNC_SIZE(name) "\n\t.size " name ",.-" name
+#endif
+
#if !defined(__GNUC__) && !defined(__clang__)
# define __ASM_BLOCK_BEGIN(name) void __asm_dummy_##name(void) {
# define __ASM_BLOCK_END }
@@ -76,7 +84,7 @@
#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_CFI(".cfi_startproc\n\t") code __ASM_CFI("\n\t.cfi_endproc") __ASM_SEH("\n\t.seh_endproc") __ASM_FUNC_SIZE(name)); \
__ASM_BLOCK_END
#define __ASM_GLOBAL_FUNC(name,code) __ASM_DEFINE_FUNC(__ASM_NAME(#name),code)
More information about the wine-cvs
mailing list