Commit 83a0c208 authored by Piotr Caban's avatar Piotr Caban Committed by Alexandre Julliard

msvcr120: Added creal implementation.

parent 84f5d8a6
......@@ -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
......
......@@ -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
......
......@@ -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)
......
......@@ -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
......
......@@ -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 */
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment