From aba6423b830939ad98f755f2a54104626483db9c Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Tue, 13 Mar 2012 15:10:15 +0100 Subject: [PATCH] msvcrt: Create an i386-specific file for exception handling. --- dlls/msvcrt/Makefile.in | 2 +- dlls/msvcrt/cpp.c | 14 ++++++++++++++ dlls/msvcrt/{cppexcept.c => except_i386.c} | 22 ++++------------------ dlls/msvcrt/msvcrt.spec | 8 ++++---- 4 files changed, 23 insertions(+), 23 deletions(-) rename dlls/msvcrt/{cppexcept.c => except_i386.c} (97%) diff --git a/dlls/msvcrt/Makefile.in b/dlls/msvcrt/Makefile.in index 1f4860a8bbc..ba8cdbbbba1 100644 --- a/dlls/msvcrt/Makefile.in +++ b/dlls/msvcrt/Makefile.in @@ -6,13 +6,13 @@ DELAYIMPORTS = advapi32 user32 C_SRCS = \ console.c \ cpp.c \ - cppexcept.c \ ctype.c \ data.c \ dir.c \ environ.c \ errno.c \ except.c \ + except_i386.c \ exit.c \ file.c \ heap.c \ diff --git a/dlls/msvcrt/cpp.c b/dlls/msvcrt/cpp.c index d5c0c64f745..dc609c1ccf7 100644 --- a/dlls/msvcrt/cpp.c +++ b/dlls/msvcrt/cpp.c @@ -1270,3 +1270,17 @@ void* CDECL MSVCRT___RTCastToVoid(void *cppobj) __ENDTRY return ret; } + + +/********************************************************************* + * _CxxThrowException (MSVCRT.@) + */ +void WINAPI _CxxThrowException( exception *object, const cxx_exception_type *type ) +{ + ULONG_PTR args[3]; + + args[0] = CXX_FRAME_MAGIC_VC6; + args[1] = (ULONG_PTR)object; + args[2] = (ULONG_PTR)type; + RaiseException( CXX_EXCEPTION, EH_NONCONTINUABLE, 3, args ); +} diff --git a/dlls/msvcrt/cppexcept.c b/dlls/msvcrt/except_i386.c similarity index 97% rename from dlls/msvcrt/cppexcept.c rename to dlls/msvcrt/except_i386.c index 18e5aa0ce8e..c95f49b3ae0 100644 --- a/dlls/msvcrt/cppexcept.c +++ b/dlls/msvcrt/except_i386.c @@ -26,6 +26,8 @@ #include "config.h" #include "wine/port.h" +#ifdef __i386__ + #include #include "windef.h" @@ -38,8 +40,6 @@ #include "cppexcept.h" -#ifdef __i386__ /* CxxFrameHandler is not supported on non-i386 */ - WINE_DEFAULT_DEBUG_CHANNEL(seh); DWORD CDECL cxx_frame_handler( PEXCEPTION_RECORD rec, cxx_exception_frame* frame, @@ -455,9 +455,6 @@ void __stdcall __CxxLongjmpUnwind( const struct MSVCRT___JUMP_BUFFER *buf ) cxx_local_unwind( frame, descr, buf->TryLevel ); } -#endif /* __i386__ */ - - /********************************************************************* * __CppXcptFilter (MSVCRT.@) */ @@ -469,19 +466,6 @@ int CDECL __CppXcptFilter(NTSTATUS ex, PEXCEPTION_POINTERS ptr) } /********************************************************************* - * _CxxThrowException (MSVCRT.@) - */ -void WINAPI _CxxThrowException( exception *object, const cxx_exception_type *type ) -{ - ULONG_PTR args[3]; - - args[0] = CXX_FRAME_MAGIC_VC6; - args[1] = (ULONG_PTR)object; - args[2] = (ULONG_PTR)type; - RaiseException( CXX_EXCEPTION, EH_NONCONTINUABLE, 3, args ); -} - -/********************************************************************* * __CxxDetectRethrow (MSVCRT.@) */ BOOL CDECL __CxxDetectRethrow(PEXCEPTION_POINTERS ptrs) @@ -511,3 +495,5 @@ unsigned int CDECL __CxxQueryExceptionSize(void) { return sizeof(cxx_exception_type); } + +#endif /* __i386__ */ diff --git a/dlls/msvcrt/msvcrt.spec b/dlls/msvcrt/msvcrt.spec index 1260dfa5d68..c8933820714 100644 --- a/dlls/msvcrt/msvcrt.spec +++ b/dlls/msvcrt/msvcrt.spec @@ -145,18 +145,18 @@ @ extern _HUGE MSVCRT__HUGE @ cdecl _Strftime(str long str ptr ptr) @ cdecl _XcptFilter(long ptr) -@ cdecl __CppXcptFilter(long ptr) +@ stdcall -arch=x86_64 __C_specific_handler(ptr long ptr ptr) ntdll.__C_specific_handler +@ cdecl -i386 __CppXcptFilter(long ptr) # stub __CxxCallUnwindDelDtor # stub __CxxCallUnwindDtor # stub __CxxCallUnwindVecDtor -@ cdecl __CxxDetectRethrow(ptr) +@ cdecl -i386 __CxxDetectRethrow(ptr) # stub __CxxExceptionFilter @ cdecl -i386 -norelay __CxxFrameHandler(ptr ptr ptr ptr) @ cdecl -i386 -norelay __CxxFrameHandler2(ptr ptr ptr ptr) __CxxFrameHandler @ cdecl -i386 -norelay __CxxFrameHandler3(ptr ptr ptr ptr) __CxxFrameHandler -@ stdcall -arch=x86_64 __C_specific_handler(ptr long ptr ptr) ntdll.__C_specific_handler @ stdcall -i386 __CxxLongjmpUnwind(ptr) -@ cdecl __CxxQueryExceptionSize() +@ cdecl -i386 __CxxQueryExceptionSize() # stub __CxxRegisterExceptionObject # stub __CxxUnregisterExceptionObject # stub __DestructExceptionObject -- 2.11.4.GIT