Commit c306c527 authored by Piotr Caban's avatar Piotr Caban Committed by Alexandre Julliard

msvcrt: Fix _CxxThrowException prototype.

parent 3884a680
...@@ -484,5 +484,5 @@ typedef struct { ...@@ -484,5 +484,5 @@ typedef struct {
double imag; double imag;
} complex_double; } complex_double;
void WINAPI DECLSPEC_NORETURN _CxxThrowException(exception*,const cxx_exception_type*); void WINAPI DECLSPEC_NORETURN _CxxThrowException(void*,const cxx_exception_type*);
void __cdecl DECLSPEC_NORETURN _Xmem(void); void __cdecl DECLSPEC_NORETURN _Xmem(void);
...@@ -1064,37 +1064,37 @@ void throw_exception(exception_type et, const char *str) ...@@ -1064,37 +1064,37 @@ void throw_exception(exception_type et, const char *str)
case EXCEPTION_LOGIC_ERROR: { case EXCEPTION_LOGIC_ERROR: {
logic_error e; logic_error e;
MSVCP_logic_error_ctor(&e, name); MSVCP_logic_error_ctor(&e, name);
_CxxThrowException((exception*)&e, &logic_error_cxx_type); _CxxThrowException(&e, &logic_error_cxx_type);
} }
case EXCEPTION_LENGTH_ERROR: { case EXCEPTION_LENGTH_ERROR: {
length_error e; length_error e;
MSVCP_length_error_ctor(&e, name); MSVCP_length_error_ctor(&e, name);
_CxxThrowException((exception*)&e, &length_error_cxx_type); _CxxThrowException(&e, &length_error_cxx_type);
} }
case EXCEPTION_OUT_OF_RANGE: { case EXCEPTION_OUT_OF_RANGE: {
out_of_range e; out_of_range e;
MSVCP_out_of_range_ctor(&e, name); MSVCP_out_of_range_ctor(&e, name);
_CxxThrowException((exception*)&e, &out_of_range_cxx_type); _CxxThrowException(&e, &out_of_range_cxx_type);
} }
case EXCEPTION_INVALID_ARGUMENT: { case EXCEPTION_INVALID_ARGUMENT: {
invalid_argument e; invalid_argument e;
MSVCP_invalid_argument_ctor(&e, name); MSVCP_invalid_argument_ctor(&e, name);
_CxxThrowException((exception*)&e, &invalid_argument_cxx_type); _CxxThrowException(&e, &invalid_argument_cxx_type);
} }
case EXCEPTION_RUNTIME_ERROR: { case EXCEPTION_RUNTIME_ERROR: {
runtime_error e; runtime_error e;
MSVCP_runtime_error_ctor(&e, name); MSVCP_runtime_error_ctor(&e, name);
_CxxThrowException((exception*)&e, &runtime_error_cxx_type); _CxxThrowException(&e, &runtime_error_cxx_type);
} }
case EXCEPTION_FAILURE: { case EXCEPTION_FAILURE: {
failure e; failure e;
MSVCP_failure_ctor(&e, name); MSVCP_failure_ctor(&e, name);
_CxxThrowException((exception*)&e, &failure_cxx_type); _CxxThrowException(&e, &failure_cxx_type);
} }
case EXCEPTION_RANGE_ERROR: { case EXCEPTION_RANGE_ERROR: {
range_error e; range_error e;
MSVCP_range_error_ctor(&e, name); MSVCP_range_error_ctor(&e, name);
_CxxThrowException((exception*)&e, &range_error_cxx_type); _CxxThrowException(&e, &range_error_cxx_type);
} }
} }
} }
......
...@@ -663,5 +663,5 @@ static inline int mbstowcs_wrapper( size_t *ret, wchar_t *wcs, size_t size, cons ...@@ -663,5 +663,5 @@ static inline int mbstowcs_wrapper( size_t *ret, wchar_t *wcs, size_t size, cons
#define hypotf( x, y ) ((float)hypot( (double)(x), (double)(y) )) #define hypotf( x, y ) ((float)hypot( (double)(x), (double)(y) ))
#endif #endif
void WINAPI DECLSPEC_NORETURN _CxxThrowException(exception*,const cxx_exception_type*); void WINAPI DECLSPEC_NORETURN _CxxThrowException(void*,const cxx_exception_type*);
void __cdecl DECLSPEC_NORETURN _Xmem(void); void __cdecl DECLSPEC_NORETURN _Xmem(void);
...@@ -620,7 +620,7 @@ static Context* get_current_context(void) ...@@ -620,7 +620,7 @@ static Context* get_current_context(void)
scheduler_resource_allocation_error e; scheduler_resource_allocation_error e;
scheduler_resource_allocation_error_ctor_name(&e, NULL, scheduler_resource_allocation_error_ctor_name(&e, NULL,
HRESULT_FROM_WIN32(GetLastError())); HRESULT_FROM_WIN32(GetLastError()));
_CxxThrowException(&e.e, &scheduler_resource_allocation_error_exception_type); _CxxThrowException(&e, &scheduler_resource_allocation_error_exception_type);
} }
if(InterlockedCompareExchange(&context_tls_index, tls_index, TLS_OUT_OF_INDEXES) != TLS_OUT_OF_INDEXES) if(InterlockedCompareExchange(&context_tls_index, tls_index, TLS_OUT_OF_INDEXES) != TLS_OUT_OF_INDEXES)
......
...@@ -755,7 +755,6 @@ const type_info* CDECL __RTtypeid(void *cppobj) ...@@ -755,7 +755,6 @@ const type_info* CDECL __RTtypeid(void *cppobj)
bad_typeid e; bad_typeid e;
bad_typeid_ctor( &e, "Attempted a typeid of NULL pointer!" ); bad_typeid_ctor( &e, "Attempted a typeid of NULL pointer!" );
_CxxThrowException( &e, &bad_typeid_exception_type ); _CxxThrowException( &e, &bad_typeid_exception_type );
return NULL;
} }
__TRY __TRY
...@@ -768,7 +767,6 @@ const type_info* CDECL __RTtypeid(void *cppobj) ...@@ -768,7 +767,6 @@ const type_info* CDECL __RTtypeid(void *cppobj)
__non_rtti_object e; __non_rtti_object e;
__non_rtti_object_ctor( &e, "Bad read pointer - no RTTI data!" ); __non_rtti_object_ctor( &e, "Bad read pointer - no RTTI data!" );
_CxxThrowException( &e, &__non_rtti_object_exception_type ); _CxxThrowException( &e, &__non_rtti_object_exception_type );
return NULL;
} }
__ENDTRY __ENDTRY
return ret; return ret;
...@@ -785,7 +783,6 @@ const type_info* CDECL __RTtypeid(void *cppobj) ...@@ -785,7 +783,6 @@ const type_info* CDECL __RTtypeid(void *cppobj)
bad_typeid e; bad_typeid e;
bad_typeid_ctor( &e, "Attempted a typeid of NULL pointer!" ); bad_typeid_ctor( &e, "Attempted a typeid of NULL pointer!" );
_CxxThrowException( &e, &bad_typeid_exception_type ); _CxxThrowException( &e, &bad_typeid_exception_type );
return NULL;
} }
__TRY __TRY
...@@ -805,7 +802,6 @@ const type_info* CDECL __RTtypeid(void *cppobj) ...@@ -805,7 +802,6 @@ const type_info* CDECL __RTtypeid(void *cppobj)
__non_rtti_object e; __non_rtti_object e;
__non_rtti_object_ctor( &e, "Bad read pointer - no RTTI data!" ); __non_rtti_object_ctor( &e, "Bad read pointer - no RTTI data!" );
_CxxThrowException( &e, &__non_rtti_object_exception_type ); _CxxThrowException( &e, &__non_rtti_object_exception_type );
return NULL;
} }
__ENDTRY __ENDTRY
return ret; return ret;
...@@ -892,7 +888,6 @@ void* CDECL __RTDynamicCast(void *cppobj, int unknown, ...@@ -892,7 +888,6 @@ void* CDECL __RTDynamicCast(void *cppobj, int unknown,
__non_rtti_object e; __non_rtti_object e;
__non_rtti_object_ctor( &e, "Access violation - no RTTI data!" ); __non_rtti_object_ctor( &e, "Access violation - no RTTI data!" );
_CxxThrowException( &e, &__non_rtti_object_exception_type ); _CxxThrowException( &e, &__non_rtti_object_exception_type );
return NULL;
} }
__ENDTRY __ENDTRY
return ret; return ret;
...@@ -955,7 +950,6 @@ void* CDECL __RTDynamicCast(void *cppobj, int unknown, ...@@ -955,7 +950,6 @@ void* CDECL __RTDynamicCast(void *cppobj, int unknown,
__non_rtti_object e; __non_rtti_object e;
__non_rtti_object_ctor( &e, "Access violation - no RTTI data!" ); __non_rtti_object_ctor( &e, "Access violation - no RTTI data!" );
_CxxThrowException( &e, &__non_rtti_object_exception_type ); _CxxThrowException( &e, &__non_rtti_object_exception_type );
return NULL;
} }
__ENDTRY __ENDTRY
return ret; return ret;
...@@ -995,7 +989,6 @@ void* CDECL __RTCastToVoid(void *cppobj) ...@@ -995,7 +989,6 @@ void* CDECL __RTCastToVoid(void *cppobj)
__non_rtti_object e; __non_rtti_object e;
__non_rtti_object_ctor( &e, "Access violation - no RTTI data!" ); __non_rtti_object_ctor( &e, "Access violation - no RTTI data!" );
_CxxThrowException( &e, &__non_rtti_object_exception_type ); _CxxThrowException( &e, &__non_rtti_object_exception_type );
return NULL;
} }
__ENDTRY __ENDTRY
return ret; return ret;
...@@ -1006,7 +999,7 @@ void* CDECL __RTCastToVoid(void *cppobj) ...@@ -1006,7 +999,7 @@ void* CDECL __RTCastToVoid(void *cppobj)
* _CxxThrowException (MSVCRT.@) * _CxxThrowException (MSVCRT.@)
*/ */
#ifndef __x86_64__ #ifndef __x86_64__
void WINAPI _CxxThrowException( exception *object, const cxx_exception_type *type ) void WINAPI _CxxThrowException( void *object, const cxx_exception_type *type )
{ {
ULONG_PTR args[3]; ULONG_PTR args[3];
...@@ -1016,7 +1009,7 @@ void WINAPI _CxxThrowException( exception *object, const cxx_exception_type *typ ...@@ -1016,7 +1009,7 @@ void WINAPI _CxxThrowException( exception *object, const cxx_exception_type *typ
RaiseException( CXX_EXCEPTION, EH_NONCONTINUABLE, 3, args ); RaiseException( CXX_EXCEPTION, EH_NONCONTINUABLE, 3, args );
} }
#else #else
void WINAPI _CxxThrowException( exception *object, const cxx_exception_type *type ) void WINAPI _CxxThrowException( void *object, const cxx_exception_type *type )
{ {
ULONG_PTR args[4]; ULONG_PTR args[4];
......
...@@ -125,7 +125,7 @@ typedef struct ...@@ -125,7 +125,7 @@ typedef struct
} cxx_exception_type; } cxx_exception_type;
#endif #endif
void WINAPI _CxxThrowException(exception*,const cxx_exception_type*); void WINAPI _CxxThrowException(void*,const cxx_exception_type*);
int CDECL _XcptFilter(NTSTATUS, PEXCEPTION_POINTERS); int CDECL _XcptFilter(NTSTATUS, PEXCEPTION_POINTERS);
static inline const char *dbgstr_type_info( const type_info *info ) static inline const char *dbgstr_type_info( const type_info *info )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment