msvcr120: Added creal implementation.

Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
oldstable
Piotr Caban 2018-10-01 19:50:45 +02:00 committed by Alexandre Julliard
parent 84f5d8a619
commit 83a0c2085f
6 changed files with 20 additions and 4 deletions

View File

@ -202,7 +202,8 @@
@ stub cproj
@ stub cprojf
@ stub cprojl
@ stub creal
@ cdecl -arch=i386 creal(double double) ucrtbase.creal
@ cdecl -arch=arm,x86_64,arm64 creal(ptr) ucrtbase.creal
@ stub crealf
@ stub creall
@ stub csin

View File

@ -2103,7 +2103,8 @@
@ stub cproj
@ stub cprojf
@ stub cprojl
@ stub creal
@ cdecl -arch=i386 creal(double double) MSVCR120_creal
@ cdecl -arch=arm,x86_64,arm64 creal(ptr) MSVCR120_creal
@ stub crealf
@ stub creall
@ stub csin

View File

@ -191,6 +191,7 @@ static void (__cdecl *p_free_locale)(_locale_t);
static unsigned short (__cdecl *p_wctype)(const char*);
static int (__cdecl *p_vsscanf)(const char*, const char *, __ms_va_list valist);
static _Dcomplex* (__cdecl *p__Cbuild)(_Dcomplex*, double, double);
static double (__cdecl *p_creal)(_Dcomplex);
/* make sure we use the correct errno */
#undef errno
@ -250,6 +251,7 @@ static BOOL init(void)
SET(p__clearfp, "_clearfp");
SET(p_vsscanf, "vsscanf");
SET(p__Cbuild, "_Cbuild");
SET(p_creal, "creal");
if(sizeof(void*) == 8) { /* 64-bit initialization */
SET(p_critical_section_ctor,
"??0critical_section@Concurrency@@QEAA@XZ");
@ -946,15 +948,20 @@ static void test_vsscanf(void)
static void test__Cbuild(void)
{
_Dcomplex c;
double d;
memset(&c, 0, sizeof(c));
p__Cbuild(&c, 1.0, 2.0);
ok(c.r == 1.0, "c.r = %lf\n", c.r);
ok(c.i == 2.0, "c.i = %lf\n", c.i);
d = p_creal(c);
ok(d == 1.0, "creal returned %lf\n", d);
p__Cbuild(&c, 3.0, NAN);
ok(c.r == 3.0, "c.r = %lf\n", c.r);
ok(_isnan(c.i), "c.i = %lf\n", c.i);
d = p_creal(c);
ok(d == 3.0, "creal returned %lf\n", d);
}
START_TEST(msvcr120)

View File

@ -1769,7 +1769,8 @@
@ stub cproj
@ stub cprojf
@ stub cprojl
@ stub creal
@ cdecl -arch=i386 creal(double double) msvcr120.creal
@ cdecl -arch=arm,x86_64,arm64 creal(ptr) msvcr120.creal
@ stub crealf
@ stub creall
@ stub csin

View File

@ -3390,4 +3390,9 @@ _Dcomplex* CDECL MSVCR120__Cbuild(_Dcomplex *ret, double r, double i)
return ret;
}
double CDECL MSVCR120_creal(_Dcomplex z)
{
return z.x;
}
#endif /* _MSVCR_VER>=120 */

View File

@ -2246,7 +2246,8 @@
@ stub cproj
@ stub cprojf
@ stub cprojl
@ stub creal
@ cdecl -arch=i386 creal(double double) MSVCR120_creal
@ cdecl -arch=arm,x86_64,arm64 creal(ptr) MSVCR120_creal
@ stub crealf
@ stub creall
@ stub csin