mirror of
git://source.winehq.org/git/wine.git
synced 2024-09-01 13:43:50 +00:00
msvcp90: Introduce throw_failure helper.
Signed-off-by: Piotr Caban <piotr@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
93455491fc
commit
d7e9190032
|
@ -4849,13 +4849,13 @@ void __thiscall ios_base_clear_reraise(ios_base *this, IOSB_iostate state, bool
|
||||||
if(reraise)
|
if(reraise)
|
||||||
_CxxThrowException(NULL, NULL);
|
_CxxThrowException(NULL, NULL);
|
||||||
else if(this->state & this->except & IOSTATE_eofbit)
|
else if(this->state & this->except & IOSTATE_eofbit)
|
||||||
throw_exception(EXCEPTION_FAILURE, "eofbit is set");
|
throw_failure("eofbit is set");
|
||||||
else if(this->state & this->except & IOSTATE_failbit)
|
else if(this->state & this->except & IOSTATE_failbit)
|
||||||
throw_exception(EXCEPTION_FAILURE, "failbit is set");
|
throw_failure("failbit is set");
|
||||||
else if(this->state & this->except & IOSTATE_badbit)
|
else if(this->state & this->except & IOSTATE_badbit)
|
||||||
throw_exception(EXCEPTION_FAILURE, "badbit is set");
|
throw_failure("badbit is set");
|
||||||
else if(this->state & this->except & IOSTATE__Hardfail)
|
else if(this->state & this->except & IOSTATE__Hardfail)
|
||||||
throw_exception(EXCEPTION_FAILURE, "_Hardfail is set");
|
throw_failure("_Hardfail is set");
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ?clear@ios_base@std@@QAEXH@Z */
|
/* ?clear@ios_base@std@@QAEXH@Z */
|
||||||
|
|
|
@ -488,3 +488,4 @@ void WINAPI DECLSPEC_NORETURN _CxxThrowException(void*,const cxx_exception_type*
|
||||||
void __cdecl DECLSPEC_NORETURN _Xlength_error(const char*);
|
void __cdecl DECLSPEC_NORETURN _Xlength_error(const char*);
|
||||||
void __cdecl DECLSPEC_NORETURN _Xmem(void);
|
void __cdecl DECLSPEC_NORETURN _Xmem(void);
|
||||||
void __cdecl DECLSPEC_NORETURN _Xout_of_range(const char*);
|
void __cdecl DECLSPEC_NORETURN _Xout_of_range(const char*);
|
||||||
|
void DECLSPEC_NORETURN throw_failure(const char*);
|
||||||
|
|
|
@ -319,7 +319,6 @@ typedef enum __exception_type {
|
||||||
EXCEPTION,
|
EXCEPTION,
|
||||||
EXCEPTION_BAD_CAST,
|
EXCEPTION_BAD_CAST,
|
||||||
EXCEPTION_LOGIC_ERROR,
|
EXCEPTION_LOGIC_ERROR,
|
||||||
EXCEPTION_FAILURE,
|
|
||||||
} exception_type;
|
} exception_type;
|
||||||
void throw_exception(exception_type, const char *);
|
void throw_exception(exception_type, const char *);
|
||||||
|
|
||||||
|
|
|
@ -1086,11 +1086,6 @@ void throw_exception(exception_type et, const char *str)
|
||||||
MSVCP_logic_error_ctor(&e, name);
|
MSVCP_logic_error_ctor(&e, name);
|
||||||
_CxxThrowException(&e, &logic_error_cxx_type);
|
_CxxThrowException(&e, &logic_error_cxx_type);
|
||||||
}
|
}
|
||||||
case EXCEPTION_FAILURE: {
|
|
||||||
failure e;
|
|
||||||
MSVCP_failure_ctor(&e, name);
|
|
||||||
_CxxThrowException(&e, &failure_cxx_type);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1104,6 +1099,16 @@ void DECLSPEC_NORETURN throw_range_error(const char *str)
|
||||||
_CxxThrowException(&e, &range_error_cxx_type);
|
_CxxThrowException(&e, &range_error_cxx_type);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Internal: throws failure exception */
|
||||||
|
void DECLSPEC_NORETURN throw_failure(const char *str)
|
||||||
|
{
|
||||||
|
exception_name name = EXCEPTION_NAME(str);
|
||||||
|
failure e;
|
||||||
|
|
||||||
|
MSVCP_failure_ctor(&e, name);
|
||||||
|
_CxxThrowException(&e, &failure_cxx_type);
|
||||||
|
}
|
||||||
|
|
||||||
void init_exception(void *base)
|
void init_exception(void *base)
|
||||||
{
|
{
|
||||||
#ifdef __x86_64__
|
#ifdef __x86_64__
|
||||||
|
|
|
@ -5266,13 +5266,13 @@ void __thiscall ios_base_clear_reraise(ios_base *this, IOSB_iostate state, bool
|
||||||
if(reraise)
|
if(reraise)
|
||||||
_CxxThrowException(NULL, NULL);
|
_CxxThrowException(NULL, NULL);
|
||||||
else if(this->state & this->except & IOSTATE_eofbit)
|
else if(this->state & this->except & IOSTATE_eofbit)
|
||||||
throw_exception(EXCEPTION_FAILURE, "eofbit is set");
|
throw_failure("eofbit is set");
|
||||||
else if(this->state & this->except & IOSTATE_failbit)
|
else if(this->state & this->except & IOSTATE_failbit)
|
||||||
throw_exception(EXCEPTION_FAILURE, "failbit is set");
|
throw_failure("failbit is set");
|
||||||
else if(this->state & this->except & IOSTATE_badbit)
|
else if(this->state & this->except & IOSTATE_badbit)
|
||||||
throw_exception(EXCEPTION_FAILURE, "badbit is set");
|
throw_failure("badbit is set");
|
||||||
else if(this->state & this->except & IOSTATE__Hardfail)
|
else if(this->state & this->except & IOSTATE__Hardfail)
|
||||||
throw_exception(EXCEPTION_FAILURE, "_Hardfail is set");
|
throw_failure("_Hardfail is set");
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ?clear@ios_base@std@@QAEXH@Z */
|
/* ?clear@ios_base@std@@QAEXH@Z */
|
||||||
|
|
|
@ -669,4 +669,5 @@ void __cdecl DECLSPEC_NORETURN _Xlength_error(const char*);
|
||||||
void __cdecl DECLSPEC_NORETURN _Xmem(void);
|
void __cdecl DECLSPEC_NORETURN _Xmem(void);
|
||||||
void __cdecl DECLSPEC_NORETURN _Xout_of_range(const char*);
|
void __cdecl DECLSPEC_NORETURN _Xout_of_range(const char*);
|
||||||
void __cdecl DECLSPEC_NORETURN _Xruntime_error(const char*);
|
void __cdecl DECLSPEC_NORETURN _Xruntime_error(const char*);
|
||||||
|
void DECLSPEC_NORETURN throw_failure(const char*);
|
||||||
void DECLSPEC_NORETURN throw_range_error(const char*);
|
void DECLSPEC_NORETURN throw_range_error(const char*);
|
||||||
|
|
Loading…
Reference in a new issue