From: Stéphane Bacri frisou76@yahoo.fr
--- dlls/msvcr120/msvcr120.spec | 4 ++-- dlls/msvcr120/tests/msvcr120.c | 16 ++++++++++++++++ dlls/msvcr120_app/msvcr120_app.spec | 4 ++-- dlls/msvcrt/math.c | 10 ++++++++++ dlls/ucrtbase/ucrtbase.spec | 4 ++-- 5 files changed, 32 insertions(+), 6 deletions(-)
diff --git a/dlls/msvcr120/msvcr120.spec b/dlls/msvcr120/msvcr120.spec index b7795e6353d..daa3d350cce 100644 --- a/dlls/msvcr120/msvcr120.spec +++ b/dlls/msvcr120/msvcr120.spec @@ -2077,7 +2077,7 @@ @ stub cexpf @ stub cexpl @ cdecl cimag(int128) -@ stub cimagf +@ cdecl cimagf(int64) @ stub cimagl @ cdecl clearerr(ptr) @ cdecl clearerr_s(ptr) @@ -2105,7 +2105,7 @@ @ stub cprojf @ stub cprojl @ cdecl creal(int128) -@ stub crealf +@ cdecl crealf(int64) @ stub creall @ stub csin @ stub csinf diff --git a/dlls/msvcr120/tests/msvcr120.c b/dlls/msvcr120/tests/msvcr120.c index 0ff8adf4453..21b1c00b4c3 100644 --- a/dlls/msvcr120/tests/msvcr120.c +++ b/dlls/msvcr120/tests/msvcr120.c @@ -230,7 +230,9 @@ static int (__cdecl *p_vsscanf)(const char*, const char *, va_list valist); static _Dcomplex (__cdecl *p__Cbuild)(double, double); static _Fcomplex (__cdecl *p__FCbuild)(float, float); static double (__cdecl *p_creal)(_Dcomplex); +static float (__cdecl *p_crealf)(_Fcomplex); static double (__cdecl *p_cimag)(_Dcomplex); +static float (__cdecl *p_cimagf)(_Fcomplex); static double (__cdecl *p_nexttoward)(double, double); static float (__cdecl *p_nexttowardf)(float, double); static double (__cdecl *p_nexttowardl)(double, double); @@ -356,6 +358,8 @@ static BOOL init(void) SET(p_creal, "creal"); SET(p_cimag, "cimag"); SET(p__FCbuild, "_FCbuild"); + SET(p_crealf, "crealf"); + SET(p_cimagf, "cimagf"); SET(p_nexttoward, "nexttoward"); SET(p_nexttowardf, "nexttowardf"); SET(p_nexttowardl, "nexttowardl"); @@ -1355,14 +1359,26 @@ static void test__FCbuild(void) c = p__FCbuild(1.0f, 2.0f); ok(c.r == 1.0f, "c.r = %lf\n", c.r); ok(c.i == 2.0f, "c.i = %lf\n", c.i); + d = p_crealf(c); + ok(d == 1.0f, "crealf returned %lf\n", d); + d = p_cimagf(c); + ok(d == 2.0f, "cimagf returned %lf\n", d);
c = p__FCbuild(3.0f, NAN); ok(c.r == 3.0f, "c.r = %lf\n", c.r); ok(_isnan(c.i), "c.i = %lf\n", c.i); + d = p_crealf(c); + ok(d == 3.0f, "crealf returned %lf\n", d); + d = p_cimagf(c); + ok(_isnan(d), "cimagf returned %lf\n", d);
c = p__FCbuild(NAN, 4.0f); ok(_isnan(c.r), "c.r = %lf\n", c.r); ok(c.i == 4.0f, "c.i = %lf\n", c.i); + d = p_crealf(c); + ok(_isnan(d), "crealf returned %lf\n", d); + d = p_cimagf(c); + ok(d == 4.0f, "cimagf returned %lf\n", d); }
static void test_nexttoward(void) diff --git a/dlls/msvcr120_app/msvcr120_app.spec b/dlls/msvcr120_app/msvcr120_app.spec index 7bf8e8a4bce..1d8ea83a468 100644 --- a/dlls/msvcr120_app/msvcr120_app.spec +++ b/dlls/msvcr120_app/msvcr120_app.spec @@ -1744,7 +1744,7 @@ @ stub cexpf @ stub cexpl @ cdecl cimag(int128) msvcr120.cimag -@ stub cimagf +@ cdecl cimagf(int64) msvcr120.cimagf @ stub cimagl @ cdecl clearerr(ptr) msvcr120.clearerr @ cdecl clearerr_s(ptr) msvcr120.clearerr_s @@ -1772,7 +1772,7 @@ @ stub cprojf @ stub cprojl @ cdecl creal(int128) msvcr120.creal -@ stub crealf +@ cdecl crealf(int64) msvcr120.crealf @ stub creall @ stub csin @ stub csinf diff --git a/dlls/msvcrt/math.c b/dlls/msvcrt/math.c index d8f3bb324e4..bcdf459396b 100644 --- a/dlls/msvcrt/math.c +++ b/dlls/msvcrt/math.c @@ -3001,4 +3001,14 @@ ULONGLONG CDECL _FCbuild(float r, float i) } #endif
+float CDECL crealf(_Fcomplex z) +{ + return z._Val[0]; +} + +float CDECL cimagf(_Fcomplex z) +{ + return z._Val[1]; +} + #endif /* _MSVCR_VER>=120 */ diff --git a/dlls/ucrtbase/ucrtbase.spec b/dlls/ucrtbase/ucrtbase.spec index 8c06f8d75ff..d7b62aa7f46 100644 --- a/dlls/ucrtbase/ucrtbase.spec +++ b/dlls/ucrtbase/ucrtbase.spec @@ -2222,7 +2222,7 @@ @ stub cexpf @ stub cexpl @ cdecl cimag(int128) -@ stub cimagf +@ cdecl cimagf(int64) @ stub cimagl @ cdecl clearerr(ptr) @ cdecl clearerr_s(ptr) @@ -2250,7 +2250,7 @@ @ stub cprojf @ stub cprojl @ cdecl creal(int128) -@ stub crealf +@ cdecl crealf(int64) @ stub creall @ stub csin @ stub csinf