msvcrt: Use floating point exception signals definition from public header.
Signed-off-by: Piotr Caban <piotr@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
45ac135519
commit
9e085387ac
|
@ -21,6 +21,7 @@
|
||||||
* FIXME: Incomplete support for nested exceptions/try block cleanup.
|
* FIXME: Incomplete support for nested exceptions/try block cleanup.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <float.h>
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
|
|
||||||
|
@ -79,13 +80,13 @@ static const struct
|
||||||
NTSTATUS status;
|
NTSTATUS status;
|
||||||
int signal;
|
int signal;
|
||||||
} float_exception_map[] = {
|
} float_exception_map[] = {
|
||||||
{ EXCEPTION_FLT_DENORMAL_OPERAND, MSVCRT__FPE_DENORMAL },
|
{ EXCEPTION_FLT_DENORMAL_OPERAND, _FPE_DENORMAL },
|
||||||
{ EXCEPTION_FLT_DIVIDE_BY_ZERO, MSVCRT__FPE_ZERODIVIDE },
|
{ EXCEPTION_FLT_DIVIDE_BY_ZERO, _FPE_ZERODIVIDE },
|
||||||
{ EXCEPTION_FLT_INEXACT_RESULT, MSVCRT__FPE_INEXACT },
|
{ EXCEPTION_FLT_INEXACT_RESULT, _FPE_INEXACT },
|
||||||
{ EXCEPTION_FLT_INVALID_OPERATION, MSVCRT__FPE_INVALID },
|
{ EXCEPTION_FLT_INVALID_OPERATION, _FPE_INVALID },
|
||||||
{ EXCEPTION_FLT_OVERFLOW, MSVCRT__FPE_OVERFLOW },
|
{ EXCEPTION_FLT_OVERFLOW, _FPE_OVERFLOW },
|
||||||
{ EXCEPTION_FLT_STACK_CHECK, MSVCRT__FPE_STACKOVERFLOW },
|
{ EXCEPTION_FLT_STACK_CHECK, _FPE_STACKOVERFLOW },
|
||||||
{ EXCEPTION_FLT_UNDERFLOW, MSVCRT__FPE_UNDERFLOW },
|
{ EXCEPTION_FLT_UNDERFLOW, _FPE_UNDERFLOW },
|
||||||
};
|
};
|
||||||
|
|
||||||
static LONG msvcrt_exception_filter(struct _EXCEPTION_POINTERS *except)
|
static LONG msvcrt_exception_filter(struct _EXCEPTION_POINTERS *except)
|
||||||
|
@ -131,7 +132,7 @@ static LONG msvcrt_exception_filter(struct _EXCEPTION_POINTERS *except)
|
||||||
{
|
{
|
||||||
EXCEPTION_POINTERS **ep = (EXCEPTION_POINTERS**)MSVCRT___pxcptinfoptrs(), *old_ep;
|
EXCEPTION_POINTERS **ep = (EXCEPTION_POINTERS**)MSVCRT___pxcptinfoptrs(), *old_ep;
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
int float_signal = MSVCRT__FPE_INVALID;
|
int float_signal = _FPE_INVALID;
|
||||||
|
|
||||||
sighandlers[MSVCRT_SIGFPE] = MSVCRT_SIG_DFL;
|
sighandlers[MSVCRT_SIGFPE] = MSVCRT_SIG_DFL;
|
||||||
for (i = 0; i < ARRAY_SIZE(float_exception_map); i++)
|
for (i = 0; i < ARRAY_SIZE(float_exception_map); i++)
|
||||||
|
@ -242,7 +243,7 @@ int CDECL MSVCRT_raise(int sig)
|
||||||
old_ep = *ep;
|
old_ep = *ep;
|
||||||
*ep = NULL;
|
*ep = NULL;
|
||||||
if (sig == MSVCRT_SIGFPE)
|
if (sig == MSVCRT_SIGFPE)
|
||||||
((float_handler)handler)(sig, MSVCRT__FPE_EXPLICITGEN);
|
((float_handler)handler)(sig, _FPE_EXPLICITGEN);
|
||||||
else
|
else
|
||||||
handler(sig);
|
handler(sig);
|
||||||
*ep = old_ep;
|
*ep = old_ep;
|
||||||
|
|
|
@ -678,18 +678,6 @@ typedef void (__cdecl *MSVCRT___sighandler_t)(int);
|
||||||
#define MSVCRT_SIG_IGN ((MSVCRT___sighandler_t)1)
|
#define MSVCRT_SIG_IGN ((MSVCRT___sighandler_t)1)
|
||||||
#define MSVCRT_SIG_ERR ((MSVCRT___sighandler_t)-1)
|
#define MSVCRT_SIG_ERR ((MSVCRT___sighandler_t)-1)
|
||||||
|
|
||||||
#define MSVCRT__FPE_INVALID 0x81
|
|
||||||
#define MSVCRT__FPE_DENORMAL 0x82
|
|
||||||
#define MSVCRT__FPE_ZERODIVIDE 0x83
|
|
||||||
#define MSVCRT__FPE_OVERFLOW 0x84
|
|
||||||
#define MSVCRT__FPE_UNDERFLOW 0x85
|
|
||||||
#define MSVCRT__FPE_INEXACT 0x86
|
|
||||||
#define MSVCRT__FPE_UNEMULATED 0x87
|
|
||||||
#define MSVCRT__FPE_SQRTNEG 0x88
|
|
||||||
#define MSVCRT__FPE_STACKOVERFLOW 0x8a
|
|
||||||
#define MSVCRT__FPE_STACKUNDERFLOW 0x8b
|
|
||||||
#define MSVCRT__FPE_EXPLICITGEN 0x8c
|
|
||||||
|
|
||||||
#define MSVCRT__TRUNCATE ((size_t)-1)
|
#define MSVCRT__TRUNCATE ((size_t)-1)
|
||||||
|
|
||||||
#define _MAX__TIME64_T (((__time64_t)0x00000007 << 32) | 0x93406FFF)
|
#define _MAX__TIME64_T (((__time64_t)0x00000007 << 32) | 0x93406FFF)
|
||||||
|
|
Loading…
Reference in New Issue