From c332b917dccf7b3c9563c24f02a1550b8a5ab600 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Thu, 10 Aug 2023 12:12:22 +0300 Subject: [PATCH] [CRT] Reduce diff to wine-5.0 --- sdk/lib/crt/except/i386/cpp.s | 16 ++++++++++++++++ sdk/lib/crt/wine/cpp.c | 2 -- sdk/lib/crt/wine/cxx.h | 6 +++++- sdk/lib/crt/wine/except_i386.c | 20 -------------------- sdk/lib/crt/wine/undname.c | 14 ++++++++------ 5 files changed, 29 insertions(+), 29 deletions(-) diff --git a/sdk/lib/crt/except/i386/cpp.s b/sdk/lib/crt/except/i386/cpp.s index 0a55393606051..7985dc1d9fe74 100644 --- a/sdk/lib/crt/except/i386/cpp.s +++ b/sdk/lib/crt/except/i386/cpp.s @@ -5,6 +5,8 @@ .code .align 4 +EXTERN _cxx_frame_handler:PROC + MACRO(DEFINE_THISCALL_ALIAS, cxxname, target) #ifdef _USE_ML EXTERN ___thiscall&target:PROC @@ -166,5 +168,19 @@ _call_handler: pop ebp ret + +PUBLIC ___CxxFrameHandler +___CxxFrameHandler: + push 0 + push 0 + push eax + push[esp + 28] + push[esp + 28] + push[esp + 28] + push[esp + 28] + call _cxx_frame_handler + add esp, 28 + ret + END diff --git a/sdk/lib/crt/wine/cpp.c b/sdk/lib/crt/wine/cpp.c index 4b12b2dfbe184..b5636b1fb1a33 100644 --- a/sdk/lib/crt/wine/cpp.c +++ b/sdk/lib/crt/wine/cpp.c @@ -995,7 +995,6 @@ void __thiscall MSVCRT_improper_scheduler_detach_dtor( #endif /* _MSVCR_VER >= 100 */ -#ifndef _MSC_VER #ifndef __GNUC__ void __asm_dummy_vtables(void) { #endif @@ -1049,7 +1048,6 @@ __ASM_VTABLE(improper_scheduler_detach, #ifndef __GNUC__ } #endif -#endif /* !_MSC_VER */ DEFINE_RTTI_DATA0( type_info, 0, ".?AVtype_info@@" ) #if _MSVCR_VER >= 80 diff --git a/sdk/lib/crt/wine/cxx.h b/sdk/lib/crt/wine/cxx.h index b22ff22cc85b2..58afc75bd1510 100644 --- a/sdk/lib/crt/wine/cxx.h +++ b/sdk/lib/crt/wine/cxx.h @@ -18,6 +18,9 @@ #include "wine/asm.h" +#ifdef _MSC_VER +#define __ASM_VTABLE(name,funcs) +#else #ifdef _WIN64 #define VTABLE_ADD_FUNC(name) "\t.quad " THISCALL_NAME(name) "\n" @@ -43,6 +46,7 @@ funcs "\n\t.text") #endif /* _WIN64 */ +#endif // _MSC_VER #ifndef __x86_64__ @@ -264,4 +268,4 @@ extern void *vtbl_wrapper_48; #endif -//exception* __thiscall MSVCRT_exception_ctor(exception*, const char**); +exception* __thiscall MSVCRT_exception_ctor(exception*, const char**); diff --git a/sdk/lib/crt/wine/except_i386.c b/sdk/lib/crt/wine/except_i386.c index 7512196c096ed..68f6c75c1b347 100644 --- a/sdk/lib/crt/wine/except_i386.c +++ b/sdk/lib/crt/wine/except_i386.c @@ -652,25 +652,6 @@ DWORD CDECL cxx_frame_handler( PEXCEPTION_RECORD rec, cxx_exception_frame* frame */ extern DWORD CDECL __CxxFrameHandler( PEXCEPTION_RECORD rec, EXCEPTION_REGISTRATION_RECORD* frame, PCONTEXT context, EXCEPTION_REGISTRATION_RECORD** dispatch ); -#ifdef _MSC_VER -DWORD _declspec(naked) __CxxFrameHandler(PEXCEPTION_RECORD rec, EXCEPTION_REGISTRATION_RECORD* frame, - PCONTEXT context, EXCEPTION_REGISTRATION_RECORD** dispatch) -{ - __asm - { - push 0 - push 0 - push eax - push[esp + 28] - push[esp + 28] - push[esp + 28] - push[esp + 28] - call cxx_frame_handler - add esp, 28 - ret - } -} -#else __ASM_GLOBAL_FUNC( __CxxFrameHandler, "pushl $0\n\t" /* nested_trylevel */ __ASM_CFI(".cfi_adjust_cfa_offset 4\n\t") @@ -690,7 +671,6 @@ __ASM_GLOBAL_FUNC( __CxxFrameHandler, "add $28,%esp\n\t" __ASM_CFI(".cfi_adjust_cfa_offset -28\n\t") "ret" ) -#endif /********************************************************************* diff --git a/sdk/lib/crt/wine/undname.c b/sdk/lib/crt/wine/undname.c index c81dfcc273a89..df3e4e8cc80ea 100644 --- a/sdk/lib/crt/wine/undname.c +++ b/sdk/lib/crt/wine/undname.c @@ -19,12 +19,15 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#define __WINE_DEBUG_CHANNEL__ -#include +#include "config.h" +#include "wine/port.h" + #include +#include +#include +#include "msvcrt.h" -#include -#include +#include "wine/debug.h" WINE_DEFAULT_DEBUG_CHANNEL(msvcrt); @@ -199,8 +202,7 @@ static BOOL str_array_push(struct parsed_symbol* sym, const char* ptr, int len, c = '>'; if (i < a->start) c = '-'; else if (i >= a->num) c = '}'; - /* This check is as useless as the unused-but-set gcc warning that we want to silence here */ - if (c != 0) TRACE("%p\t%d%c %s\n", a, i, c, debugstr_a(a->elts[i])); + TRACE("%p\t%d%c %s\n", a, i, c, debugstr_a(a->elts[i])); } }