From: Stéphane Bacri frisou76@yahoo.fr
--- dlls/msvcr120/msvcr120.spec | 2 +- dlls/msvcr120/tests/msvcr120.c | 6 ++++++ dlls/msvcr120_app/msvcr120_app.spec | 2 +- dlls/msvcrt/math.c | 5 +++++ dlls/ucrtbase/ucrtbase.spec | 2 +- 5 files changed, 14 insertions(+), 3 deletions(-)
diff --git a/dlls/msvcr120/msvcr120.spec b/dlls/msvcr120/msvcr120.spec index d0b2ca9f2cf..49931ea677d 100644 --- a/dlls/msvcr120/msvcr120.spec +++ b/dlls/msvcr120/msvcr120.spec @@ -2076,7 +2076,7 @@ @ stub cexp @ stub cexpf @ stub cexpl -@ stub cimag +@ cdecl cimag(int128) @ stub cimagf @ stub cimagl @ cdecl clearerr(ptr) diff --git a/dlls/msvcr120/tests/msvcr120.c b/dlls/msvcr120/tests/msvcr120.c index f63c86384d8..53cd0431cc5 100644 --- a/dlls/msvcr120/tests/msvcr120.c +++ b/dlls/msvcr120/tests/msvcr120.c @@ -223,6 +223,7 @@ static unsigned short (__cdecl *p_wctype)(const char*); static int (__cdecl *p_vsscanf)(const char*, const char *, va_list valist); static _Dcomplex (__cdecl *p__Cbuild)(double, double); static double (__cdecl *p_creal)(_Dcomplex); +static double (__cdecl *p_cimag)(_Dcomplex); static double (__cdecl *p_nexttoward)(double, double); static float (__cdecl *p_nexttowardf)(float, double); static double (__cdecl *p_nexttowardl)(double, double); @@ -333,6 +334,7 @@ static BOOL init(void) SET(p_vsscanf, "vsscanf"); SET(p__Cbuild, "_Cbuild"); SET(p_creal, "creal"); + SET(p_cimag, "cimag"); SET(p_nexttoward, "nexttoward"); SET(p_nexttowardf, "nexttowardf"); SET(p_nexttowardl, "nexttowardl"); @@ -1302,6 +1304,8 @@ static void test__Cbuild(void) ok(c.i == 2.0, "c.i = %lf\n", c.i); d = p_creal(c); ok(d == 1.0, "creal returned %lf\n", d); + d = p_cimag(c); + ok(d == 2.0, "cimag returned %lf\n", d);
c = p__Cbuild(3.0, NAN); ok(c.r == 3.0, "c.r = %lf\n", c.r); @@ -1312,6 +1316,8 @@ static void test__Cbuild(void) c = p__Cbuild(NAN, 4.0); ok(_isnan(c.r), "c.r = %lf\n", c.r); ok(c.i == 4.0, "c.i = %lf\n", c.i); + d = p_cimag(c); + ok(d == 4.0, "cimag 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 80ab50de9dc..7f44909650f 100644 --- a/dlls/msvcr120_app/msvcr120_app.spec +++ b/dlls/msvcr120_app/msvcr120_app.spec @@ -1743,7 +1743,7 @@ @ stub cexp @ stub cexpf @ stub cexpl -@ stub cimag +@ cdecl cimag(int128) msvcr120.cimag @ stub cimagf @ stub cimagl @ cdecl clearerr(ptr) msvcr120.clearerr diff --git a/dlls/msvcrt/math.c b/dlls/msvcrt/math.c index c620cb5fab9..9024dd03a85 100644 --- a/dlls/msvcrt/math.c +++ b/dlls/msvcrt/math.c @@ -2971,4 +2971,9 @@ double CDECL MSVCR120_creal(_Dcomplex z) return z._Val[0]; }
+double CDECL cimag(_Dcomplex z) +{ + return z._Val[1]; +} + #endif /* _MSVCR_VER>=120 */ diff --git a/dlls/ucrtbase/ucrtbase.spec b/dlls/ucrtbase/ucrtbase.spec index f3fda78e379..2480a0d538c 100644 --- a/dlls/ucrtbase/ucrtbase.spec +++ b/dlls/ucrtbase/ucrtbase.spec @@ -2221,7 +2221,7 @@ @ stub cexp @ stub cexpf @ stub cexpl -@ stub cimag +@ cdecl cimag(int128) @ stub cimagf @ stub cimagl @ cdecl clearerr(ptr)