mirror of
https://github.com/reactos/reactos.git
synced 2025-04-27 17:10:22 +00:00
[CRT] Improve _matherr handling
This commit is contained in:
parent
4d50f81419
commit
3d497ca883
2 changed files with 15 additions and 6 deletions
|
@ -1,12 +1,10 @@
|
||||||
/*
|
/*
|
||||||
* PROJECT: ReactOS CRT library
|
* PROJECT: ReactOS CRT library
|
||||||
* LICENSE: MIT (https://spdx.org/licenses/MIT)
|
* LICENSE: MIT (https://spdx.org/licenses/MIT)
|
||||||
* PURPOSE: Implementation of __setusermatherr and _invoke_user_matherr
|
* PURPOSE: Implementation of _invoke_matherr and __setusermatherr
|
||||||
* COPYRIGHT: Copyright 2021 Timo Kreuzer <timo.kreuzer@reactos.org>
|
* COPYRIGHT: Copyright 2021 Timo Kreuzer <timo.kreuzer@reactos.org>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// DO NOT SYNC WITH WINE OR MINGW32
|
|
||||||
|
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
|
||||||
/* MS headers have this in corecrt_startup.h */
|
/* MS headers have this in corecrt_startup.h */
|
||||||
|
@ -23,11 +21,22 @@ __setusermatherr(_UserMathErrorFunctionPointer func)
|
||||||
|
|
||||||
int
|
int
|
||||||
__cdecl
|
__cdecl
|
||||||
_invoke_user_matherr(struct _exception *e)
|
_invoke_matherr(
|
||||||
|
int type,
|
||||||
|
char* name,
|
||||||
|
double arg1,
|
||||||
|
double arg2,
|
||||||
|
double retval)
|
||||||
{
|
{
|
||||||
if (user_matherr != NULL)
|
if (user_matherr != NULL)
|
||||||
{
|
{
|
||||||
return user_matherr(e);
|
struct _exception excpt;
|
||||||
|
excpt.type = type;
|
||||||
|
excpt.name = name;
|
||||||
|
excpt.arg1 = arg1;
|
||||||
|
excpt.arg2 = arg2;
|
||||||
|
excpt.retval = retval;
|
||||||
|
return user_matherr(&excpt);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
|
@ -1,9 +1,9 @@
|
||||||
|
|
||||||
list(APPEND LIBCNTPR_MATH_SOURCE
|
list(APPEND LIBCNTPR_MATH_SOURCE
|
||||||
|
math/_invoke_matherr.c
|
||||||
math/abs.c
|
math/abs.c
|
||||||
math/div.c
|
math/div.c
|
||||||
math/labs.c
|
math/labs.c
|
||||||
math/usermatherr.c
|
|
||||||
)
|
)
|
||||||
|
|
||||||
if(ARCH STREQUAL "i386")
|
if(ARCH STREQUAL "i386")
|
||||||
|
|
Loading…
Reference in a new issue