msvcr120: Add _dsign implementation.

This commit is contained in:
Piotr Caban 2015-05-26 14:54:49 +02:00 committed by Alexandre Julliard
parent ec2f02db0c
commit 530d269e01
4 changed files with 46 additions and 6 deletions

View File

@ -1109,7 +1109,7 @@
@ cdecl _difftime64(long long) MSVCRT__difftime64
@ stub _dosmaperr
@ stub _dpcomp
@ stub _dsign
@ cdecl _dsign(double) MSVCR120__dsign
@ extern _dstbias MSVCRT__dstbias
@ cdecl _dtest(ptr) MSVCR120__dtest
@ cdecl _dup(long) MSVCRT__dup
@ -1143,7 +1143,7 @@
@ cdecl _fdclass(float) MSVCR120__fdclass
@ cdecl _fdopen(long str) MSVCRT__fdopen
@ stub _fdpcomp
@ stub _fdsign
@ cdecl _fdsign(float) MSVCR120__fdsign
@ cdecl _fdtest(ptr) MSVCR120__fdtest
@ cdecl _fflush_nolock(ptr) MSVCRT__fflush_nolock
@ cdecl _fgetc_nolock(ptr) MSVCRT__fgetc_nolock
@ -1391,7 +1391,7 @@
@ cdecl _kbhit()
@ cdecl _ldclass(double) MSVCR120__ldclass
@ stub _ldpcomp
@ stub _ldsign
@ cdecl _ldsign(double) MSVCR120__dsign
@ cdecl _ldtest(ptr) MSVCR120__ldtest
@ cdecl _lfind(ptr ptr ptr long ptr)
@ stub _lfind_s

View File

@ -61,6 +61,8 @@ struct MSVCRT_lconv
static char* (CDECL *p_setlocale)(int category, const char* locale);
static struct MSVCRT_lconv* (CDECL *p_localeconv)(void);
static size_t (CDECL *p_wcstombs_s)(size_t *ret, char* dest, size_t sz, const wchar_t* src, size_t max);
static int (CDECL *p__dsign)(double);
static int (CDECL *p__fdsign)(float);
static BOOL init(void)
{
@ -76,6 +78,8 @@ static BOOL init(void)
p_setlocale = (void*)GetProcAddress(module, "setlocale");
p_localeconv = (void*)GetProcAddress(module, "localeconv");
p_wcstombs_s = (void*)GetProcAddress(module, "wcstombs_s");
p__dsign = (void*)GetProcAddress(module, "_dsign");
p__fdsign = (void*)GetProcAddress(module, "_fdsign");
return TRUE;
}
@ -148,8 +152,28 @@ static void test_lconv(void)
test_lconv_helper(locstrs[i]);
}
static void test__dsign(void)
{
int ret;
ret = p__dsign(1);
ok(ret == 0, "p_dsign(1) = %x\n", ret);
ret = p__dsign(0);
ok(ret == 0, "p_dsign(0) = %x\n", ret);
ret = p__dsign(-1);
ok(ret == 0x8000, "p_dsign(-1) = %x\n", ret);
ret = p__fdsign(1);
ok(ret == 0, "p_fdsign(1) = %x\n", ret);
ret = p__fdsign(0);
ok(ret == 0, "p_fdsign(0) = %x\n", ret);
ret = p__fdsign(-1);
ok(ret == 0x8000, "p_fdsign(-1) = %x\n", ret);
}
START_TEST(msvcr120)
{
if (!init()) return;
test_lconv();
test__dsign();
}

View File

@ -1050,7 +1050,7 @@
@ cdecl _difftime64(long long) msvcr120._difftime64
@ stub _dosmaperr
@ stub _dpcomp
@ stub _dsign
@ cdecl _dsign(double) msvcr120._dsign
@ extern _dstbias msvcr120._dstbias
@ cdecl _dtest(ptr) msvcr120._dtest
@ cdecl _dup(long) msvcr120._dup
@ -1073,7 +1073,7 @@
@ cdecl _fdclass(float) msvcr120._fdclass
@ cdecl _fdopen(long str) msvcr120._fdopen
@ stub _fdpcomp
@ stub _fdsign
@ cdecl _fdsign(float) msvcr120._fdsign
@ cdecl _fdtest(ptr) msvcr120._fdtest
@ cdecl _fflush_nolock(ptr) msvcr120._fflush_nolock
@ cdecl _fgetc_nolock(ptr) msvcr120._fgetc_nolock
@ -1257,7 +1257,7 @@
@ cdecl _jn(long double) msvcr120._jn
@ cdecl _ldclass(double) msvcr120._ldclass
@ stub _ldpcomp
@ stub _ldsign
@ cdecl _ldsign(double) msvcr120._ldsign
@ cdecl _ldtest(ptr) msvcr120._ldtest
@ cdecl _lfind(ptr ptr ptr long ptr) msvcr120._lfind
@ stub _lfind_s

View File

@ -2633,3 +2633,19 @@ double CDECL MSVCR120_fmax(double x, double y)
return signbit(x) ? y : x;
return x<y ? y : x;
}
/*********************************************************************
* _fdsign (MSVCR120.@)
*/
int CDECL MSVCR120__fdsign(float x)
{
return signbit(x) ? 0x8000 : 0;
}
/*********************************************************************
* _dsign (MSVCR120.@)
*/
int CDECL MSVCR120__dsign(double x)
{
return signbit(x) ? 0x8000 : 0;
}