diff --git a/dlls/msvcrt/math.c b/dlls/msvcrt/math.c index ca181d907bf..754e46ce66d 100644 --- a/dlls/msvcrt/math.c +++ b/dlls/msvcrt/math.c @@ -62,24 +62,26 @@ void msvcrt_init_math(void) } /********************************************************************* - * _matherr (MSVCRT.@) + * _matherr (CRTDLL.@) */ int CDECL MSVCRT__matherr(struct MSVCRT__exception *e) { - int ret; + return 0; +} - if (e) - TRACE("(%p = {%d, \"%s\", %g, %g, %g})\n", e, e->type, e->name, e->arg1, e->arg2, e->retval); - else - TRACE("(null)\n"); + +static void math_error(int type, const char *name, double arg1, double arg2, double retval) +{ + TRACE("(%d, %s, %g, %g, %g)\n", type, debugstr_a(name), arg1, arg2, retval); if (MSVCRT_default_matherr_func) { - ret = MSVCRT_default_matherr_func(e); - if (ret) return ret; + struct MSVCRT__exception exception = {type, (char *)name, arg1, arg2, retval}; + + if (MSVCRT_default_matherr_func(&exception)) return; } - switch (e->type) + switch (type) { case _DOMAIN: *MSVCRT__errno() = MSVCRT_EDOM; @@ -94,8 +96,6 @@ int CDECL MSVCRT__matherr(struct MSVCRT__exception *e) default: ERR("Unhandled math error!\n"); } - - return 0; } /********************************************************************* @@ -107,12 +107,6 @@ void CDECL MSVCRT___setusermatherr(MSVCRT_matherr_func func) TRACE("new matherr handler %p\n", func); } -static inline void math_error(int type, const char *name, double arg1, double arg2, double retval) -{ - struct MSVCRT__exception exception = {type, (char *)name, arg1, arg2, retval}; - MSVCRT__matherr(&exception); -} - /********************************************************************* * _set_SSE2_enable (MSVCRT.@) */ diff --git a/dlls/msvcrt/msvcrt.spec b/dlls/msvcrt/msvcrt.spec index 101e2c7ce5f..0c2881d87b6 100644 --- a/dlls/msvcrt/msvcrt.spec +++ b/dlls/msvcrt/msvcrt.spec @@ -683,7 +683,6 @@ @ cdecl _makepath(ptr str str str str) MSVCRT__makepath @ cdecl _makepath_s(ptr long str str str str) MSVCRT__makepath_s # stub _malloc_dbg(long long str long) -@ cdecl _matherr(ptr) MSVCRT__matherr @ cdecl _mbbtombc(long) # stub _mbbtombc_l(long ptr) @ cdecl _mbbtype(long long) diff --git a/dlls/msvcrt20/msvcrt20.c b/dlls/msvcrt20/msvcrt20.c index e8d2b3cd378..3cb1e678c10 100644 --- a/dlls/msvcrt20/msvcrt20.c +++ b/dlls/msvcrt20/msvcrt20.c @@ -19,6 +19,7 @@ */ #include +#include #include "windef.h" @@ -48,3 +49,12 @@ void CDECL MSVCRT20__wgetmainargs( int *argc, WCHAR** *wargv, WCHAR** *wenvp, { __wgetmainargs( argc, wargv, wenvp, expand_wildcards, &new_mode ); } + + +/********************************************************************* + * _matherr (MSVCRT20.@) + */ +int CDECL MSVCRT20__matherr(struct _exception *e) +{ + return 0; +} diff --git a/dlls/msvcrt20/msvcrt20.spec b/dlls/msvcrt20/msvcrt20.spec index 6ced0fde427..84a1014b79a 100644 --- a/dlls/msvcrt20/msvcrt20.spec +++ b/dlls/msvcrt20/msvcrt20.spec @@ -1012,7 +1012,7 @@ @ cdecl _ltoa(long ptr long) msvcrt._ltoa @ cdecl _ltow(long ptr long) msvcrt._ltow @ cdecl _makepath(ptr str str str str) msvcrt._makepath -@ cdecl _matherr(ptr) msvcrt._matherr +@ cdecl _matherr(ptr) MSVCRT20__matherr @ cdecl _mbbtombc(long) msvcrt._mbbtombc @ cdecl _mbbtype(long long) msvcrt._mbbtype @ cdecl _mbccpy(ptr ptr) msvcrt._mbccpy