diff --git a/sdk/lib/crt/math/usermatherr.c b/sdk/lib/crt/math/_invoke_matherr.c similarity index 59% rename from sdk/lib/crt/math/usermatherr.c rename to sdk/lib/crt/math/_invoke_matherr.c index 283a42cd5d0..e36b349bcdc 100644 --- a/sdk/lib/crt/math/usermatherr.c +++ b/sdk/lib/crt/math/_invoke_matherr.c @@ -1,12 +1,10 @@ /* * PROJECT: ReactOS CRT library * 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 */ -// DO NOT SYNC WITH WINE OR MINGW32 - #include /* MS headers have this in corecrt_startup.h */ @@ -23,11 +21,22 @@ __setusermatherr(_UserMathErrorFunctionPointer func) int __cdecl -_invoke_user_matherr(struct _exception *e) +_invoke_matherr( + int type, + char* name, + double arg1, + double arg2, + double retval) { 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 { diff --git a/sdk/lib/crt/math/math.cmake b/sdk/lib/crt/math/math.cmake index e50d2bfa680..42fbc012bbe 100644 --- a/sdk/lib/crt/math/math.cmake +++ b/sdk/lib/crt/math/math.cmake @@ -1,9 +1,9 @@ list(APPEND LIBCNTPR_MATH_SOURCE + math/_invoke_matherr.c math/abs.c math/div.c math/labs.c - math/usermatherr.c ) if(ARCH STREQUAL "i386")