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 017155c65d5..3733a524382 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 @@ -89,7 +89,7 @@ @ cdecl exit(long) ucrtbase.exit @ cdecl feclearexcept(long) ucrtbase.feclearexcept @ cdecl fegetenv(ptr) ucrtbase.fegetenv -@ stub fegetexceptflag +@ cdecl fegetexceptflag(ptr long) ucrtbase.fegetexceptflag @ cdecl fegetround() ucrtbase.fegetround @ stub feholdexcept @ cdecl fesetenv(ptr) ucrtbase.fesetenv diff --git a/dlls/msvcr120/msvcr120.spec b/dlls/msvcr120/msvcr120.spec index 105c349355e..306bee5f50c 100644 --- a/dlls/msvcr120/msvcr120.spec +++ b/dlls/msvcr120/msvcr120.spec @@ -2145,7 +2145,7 @@ @ cdecl fdiml(double double) fdim @ cdecl feclearexcept(long) @ cdecl fegetenv(ptr) -@ stub fegetexceptflag +@ cdecl fegetexceptflag(ptr long) @ cdecl fegetround() @ stub feholdexcept @ cdecl feof(ptr) diff --git a/dlls/msvcr120/tests/msvcr120.c b/dlls/msvcr120/tests/msvcr120.c index cff6128bbe9..151989f8f74 100644 --- a/dlls/msvcr120/tests/msvcr120.c +++ b/dlls/msvcr120/tests/msvcr120.c @@ -182,6 +182,7 @@ static int (CDECL *p_fegetenv)(fenv_t*); 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_fesetexceptflag)(const fexcept_t*,int); static int (CDECL *p_fetestexcept)(int); static int (CDECL *p_feclearexcept)(int); @@ -260,6 +261,7 @@ static BOOL init(void) SET(p_fesetenv, "fesetenv"); SET(p_fegetround, "fegetround"); SET(p_fesetround, "fesetround"); + SET(p_fegetexceptflag, "fegetexceptflag"); SET(p_fesetexceptflag, "fesetexceptflag"); SET(p_fetestexcept, "fetestexcept"); SET(p_feclearexcept, "feclearexcept"); @@ -849,6 +851,7 @@ static void test_feenv(void) if(0) { /* crash on windows */ p_fesetexceptflag(NULL, FE_ALL_EXCEPT); + p_fegetexceptflag(NULL, 0); } except = FE_ALL_EXCEPT; ret = p_fesetexceptflag(&except, FE_INEXACT|FE_UNDERFLOW); @@ -890,6 +893,16 @@ static void test_feenv(void) flags |= tests[i]; ret = p_fetestexcept(FE_ALL_EXCEPT); ok(ret == flags, "Test %d: expected %x, got %x\n", i, flags, ret); + + except = ~0; + ret = p_fegetexceptflag(&except, ~0); + ok(!ret, "Test %d: fegetexceptflag returned %x.\n", i, ret); + ok(except == flags, "Test %d: expected %x, got %lx\n", i, flags, except); + + except = ~0; + ret = p_fegetexceptflag(&except, tests[i]); + ok(!ret, "Test %d: fegetexceptflag returned %x.\n", i, ret); + ok(except == tests[i], "Test %d: expected %x, got %lx\n", i, tests[i], except); } for(i=0; i=140 diff --git a/dlls/ucrtbase/ucrtbase.spec b/dlls/ucrtbase/ucrtbase.spec index 1df40c81b76..8f331825fc4 100644 --- a/dlls/ucrtbase/ucrtbase.spec +++ b/dlls/ucrtbase/ucrtbase.spec @@ -2288,7 +2288,7 @@ @ cdecl fdiml(double double) fdim @ cdecl feclearexcept(long) @ cdecl fegetenv(ptr) -@ stub fegetexceptflag +@ cdecl fegetexceptflag(ptr long) @ cdecl fegetround() @ stub feholdexcept @ cdecl feof(ptr) diff --git a/include/msvcrt/fenv.h b/include/msvcrt/fenv.h index b37fbc100bf..a6b53eca567 100644 --- a/include/msvcrt/fenv.h +++ b/include/msvcrt/fenv.h @@ -34,6 +34,7 @@ typedef __msvcrt_ulong fexcept_t; _ACRTIMP int __cdecl fegetenv(fenv_t*); _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 fesetexceptflag(const fexcept_t*, int);