Signed-off-by: Daniel Lehman dlehman25@gmail.com --- .../api-ms-win-crt-runtime-l1-1-0.spec | 2 +- dlls/msvcr120/msvcr120.spec | 2 +- dlls/msvcr120/tests/msvcr120.c | 5 +++++ dlls/msvcr120_app/msvcr120_app.spec | 2 +- dlls/msvcrt/math.c | 10 ++++++++++ dlls/ucrtbase/ucrtbase.spec | 2 +- include/msvcrt/fenv.h | 1 + 7 files changed, 20 insertions(+), 4 deletions(-)
diff --git a/dlls/api-ms-win-crt-runtime-l1-1-0/api-ms-win-crt-runtime-l1-1-0.spec b/dlls/api-ms-win-crt-runtime-l1-1-0/api-ms-win-crt-runtime-l1-1-0.spec index 59b0c567216..1d0b6e06b7c 100644 --- a/dlls/api-ms-win-crt-runtime-l1-1-0/api-ms-win-crt-runtime-l1-1-0.spec +++ b/dlls/api-ms-win-crt-runtime-l1-1-0/api-ms-win-crt-runtime-l1-1-0.spec @@ -95,7 +95,7 @@ @ cdecl fesetenv(ptr) ucrtbase.fesetenv @ stub fesetexceptflag @ cdecl fesetround(long) ucrtbase.fesetround -@ stub fetestexcept +@ cdecl fetestexcept(long) ucrtbase.fetestexcept @ cdecl perror(str) ucrtbase.perror @ cdecl quick_exit(long) ucrtbase.quick_exit @ cdecl raise(long) ucrtbase.raise diff --git a/dlls/msvcr120/msvcr120.spec b/dlls/msvcr120/msvcr120.spec index 776d701e780..d9628883f34 100644 --- a/dlls/msvcr120/msvcr120.spec +++ b/dlls/msvcr120/msvcr120.spec @@ -2154,7 +2154,7 @@ @ cdecl fesetenv(ptr) @ stub fesetexceptflag @ cdecl fesetround(long) -@ stub fetestexcept +@ cdecl fetestexcept(long) @ stub feupdateenv @ cdecl fflush(ptr) @ cdecl fgetc(ptr) diff --git a/dlls/msvcr120/tests/msvcr120.c b/dlls/msvcr120/tests/msvcr120.c index d6e93b97629..a34c336d94d 100644 --- a/dlls/msvcr120/tests/msvcr120.c +++ b/dlls/msvcr120/tests/msvcr120.c @@ -183,6 +183,7 @@ static int (CDECL *p_fesetenv)(const fenv_t*); static int (CDECL *p_fegetround)(void); static int (CDECL *p_fesetround)(int); static int (CDECL *p_fegetexceptflag)(fexcept_t*,int); +static int (CDECL *p_fetestexcept)(int); static int (CDECL *p__clearfp)(void); static _locale_t (__cdecl *p_wcreate_locale)(int, const wchar_t *); static void (__cdecl *p_free_locale)(_locale_t); @@ -259,6 +260,7 @@ static BOOL init(void) SET(p_fegetround, "fegetround"); SET(p_fesetround, "fesetround"); SET(p_fegetexceptflag, "fegetexceptflag"); + SET(p_fetestexcept, "fetestexcept");
SET(p__clearfp, "_clearfp"); SET(p_vsscanf, "vsscanf"); @@ -839,6 +841,9 @@ static void test_feenv(void) ret = p_fegetexceptflag(&except, tests[i].get); ok(!ret, "fegetexceptflag returned %x.\n", ret); ok(except == tests[i].expect, "expected %lx, got %lx\n", tests[i].expect, except); + + except = p_fetestexcept(tests[i].get); + ok(except == tests[i].expect, "expected %lx, got %lx\n", tests[i].expect, except); }
p__clearfp(); diff --git a/dlls/msvcr120_app/msvcr120_app.spec b/dlls/msvcr120_app/msvcr120_app.spec index a3be94e4a6c..152eda3be81 100644 --- a/dlls/msvcr120_app/msvcr120_app.spec +++ b/dlls/msvcr120_app/msvcr120_app.spec @@ -1820,7 +1820,7 @@ @ cdecl fesetenv(ptr) msvcr120.fesetenv @ stub fesetexceptflag @ cdecl fesetround(long) msvcr120.fesetround -@ stub fetestexcept +@ cdecl fetestexcept(long) msvcr120.fetestexcept @ stub feupdateenv @ cdecl fflush(ptr) msvcr120.fflush @ cdecl fgetc(ptr) msvcr120.fgetc diff --git a/dlls/msvcrt/math.c b/dlls/msvcrt/math.c index 996059cc036..5ae5f2e5d6c 100644 --- a/dlls/msvcrt/math.c +++ b/dlls/msvcrt/math.c @@ -2227,6 +2227,16 @@ int CDECL fegetexceptflag(fexcept_t *status, int excepts) *status = env._Fe_stat & excepts & FE_ALL_EXCEPT; return rc; } + +/********************************************************************* + * fetestexcept (MSVCR120.@) + */ +int CDECL fetestexcept(int flags) +{ + fexcept_t except; + fegetexceptflag(&except, flags); + return except; +} #endif
#if _MSVCR_VER>=140 diff --git a/dlls/ucrtbase/ucrtbase.spec b/dlls/ucrtbase/ucrtbase.spec index 41b1b79896d..4f842c58d27 100644 --- a/dlls/ucrtbase/ucrtbase.spec +++ b/dlls/ucrtbase/ucrtbase.spec @@ -2296,7 +2296,7 @@ @ cdecl fesetenv(ptr) @ stub fesetexceptflag @ cdecl fesetround(long) -@ stub fetestexcept +@ cdecl fetestexcept(long) @ cdecl fflush(ptr) @ cdecl fgetc(ptr) @ cdecl fgetpos(ptr ptr) diff --git a/include/msvcrt/fenv.h b/include/msvcrt/fenv.h index 56db8ea28b8..0ddb6852368 100644 --- a/include/msvcrt/fenv.h +++ b/include/msvcrt/fenv.h @@ -37,6 +37,7 @@ _ACRTIMP int __cdecl fesetenv(const fenv_t*); _ACRTIMP int __cdecl fegetexceptflag(fexcept_t*, int); _ACRTIMP int __cdecl fegetround(void); _ACRTIMP int __cdecl fesetround(int); +_ACRTIMP int __cdecl fetestexcept(int);
#ifdef __cplusplus }