Commit 530d269e authored by Piotr Caban's avatar Piotr Caban Committed by Alexandre Julliard

msvcr120: Add _dsign implementation.

parent ec2f02db
...@@ -1109,7 +1109,7 @@ ...@@ -1109,7 +1109,7 @@
@ cdecl _difftime64(long long) MSVCRT__difftime64 @ cdecl _difftime64(long long) MSVCRT__difftime64
@ stub _dosmaperr @ stub _dosmaperr
@ stub _dpcomp @ stub _dpcomp
@ stub _dsign @ cdecl _dsign(double) MSVCR120__dsign
@ extern _dstbias MSVCRT__dstbias @ extern _dstbias MSVCRT__dstbias
@ cdecl _dtest(ptr) MSVCR120__dtest @ cdecl _dtest(ptr) MSVCR120__dtest
@ cdecl _dup(long) MSVCRT__dup @ cdecl _dup(long) MSVCRT__dup
...@@ -1143,7 +1143,7 @@ ...@@ -1143,7 +1143,7 @@
@ cdecl _fdclass(float) MSVCR120__fdclass @ cdecl _fdclass(float) MSVCR120__fdclass
@ cdecl _fdopen(long str) MSVCRT__fdopen @ cdecl _fdopen(long str) MSVCRT__fdopen
@ stub _fdpcomp @ stub _fdpcomp
@ stub _fdsign @ cdecl _fdsign(float) MSVCR120__fdsign
@ cdecl _fdtest(ptr) MSVCR120__fdtest @ cdecl _fdtest(ptr) MSVCR120__fdtest
@ cdecl _fflush_nolock(ptr) MSVCRT__fflush_nolock @ cdecl _fflush_nolock(ptr) MSVCRT__fflush_nolock
@ cdecl _fgetc_nolock(ptr) MSVCRT__fgetc_nolock @ cdecl _fgetc_nolock(ptr) MSVCRT__fgetc_nolock
...@@ -1391,7 +1391,7 @@ ...@@ -1391,7 +1391,7 @@
@ cdecl _kbhit() @ cdecl _kbhit()
@ cdecl _ldclass(double) MSVCR120__ldclass @ cdecl _ldclass(double) MSVCR120__ldclass
@ stub _ldpcomp @ stub _ldpcomp
@ stub _ldsign @ cdecl _ldsign(double) MSVCR120__dsign
@ cdecl _ldtest(ptr) MSVCR120__ldtest @ cdecl _ldtest(ptr) MSVCR120__ldtest
@ cdecl _lfind(ptr ptr ptr long ptr) @ cdecl _lfind(ptr ptr ptr long ptr)
@ stub _lfind_s @ stub _lfind_s
......
...@@ -61,6 +61,8 @@ struct MSVCRT_lconv ...@@ -61,6 +61,8 @@ struct MSVCRT_lconv
static char* (CDECL *p_setlocale)(int category, const char* locale); static char* (CDECL *p_setlocale)(int category, const char* locale);
static struct MSVCRT_lconv* (CDECL *p_localeconv)(void); 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 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) static BOOL init(void)
{ {
...@@ -76,6 +78,8 @@ static BOOL init(void) ...@@ -76,6 +78,8 @@ static BOOL init(void)
p_setlocale = (void*)GetProcAddress(module, "setlocale"); p_setlocale = (void*)GetProcAddress(module, "setlocale");
p_localeconv = (void*)GetProcAddress(module, "localeconv"); p_localeconv = (void*)GetProcAddress(module, "localeconv");
p_wcstombs_s = (void*)GetProcAddress(module, "wcstombs_s"); p_wcstombs_s = (void*)GetProcAddress(module, "wcstombs_s");
p__dsign = (void*)GetProcAddress(module, "_dsign");
p__fdsign = (void*)GetProcAddress(module, "_fdsign");
return TRUE; return TRUE;
} }
...@@ -148,8 +152,28 @@ static void test_lconv(void) ...@@ -148,8 +152,28 @@ static void test_lconv(void)
test_lconv_helper(locstrs[i]); 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) START_TEST(msvcr120)
{ {
if (!init()) return; if (!init()) return;
test_lconv(); test_lconv();
test__dsign();
} }
...@@ -1050,7 +1050,7 @@ ...@@ -1050,7 +1050,7 @@
@ cdecl _difftime64(long long) msvcr120._difftime64 @ cdecl _difftime64(long long) msvcr120._difftime64
@ stub _dosmaperr @ stub _dosmaperr
@ stub _dpcomp @ stub _dpcomp
@ stub _dsign @ cdecl _dsign(double) msvcr120._dsign
@ extern _dstbias msvcr120._dstbias @ extern _dstbias msvcr120._dstbias
@ cdecl _dtest(ptr) msvcr120._dtest @ cdecl _dtest(ptr) msvcr120._dtest
@ cdecl _dup(long) msvcr120._dup @ cdecl _dup(long) msvcr120._dup
...@@ -1073,7 +1073,7 @@ ...@@ -1073,7 +1073,7 @@
@ cdecl _fdclass(float) msvcr120._fdclass @ cdecl _fdclass(float) msvcr120._fdclass
@ cdecl _fdopen(long str) msvcr120._fdopen @ cdecl _fdopen(long str) msvcr120._fdopen
@ stub _fdpcomp @ stub _fdpcomp
@ stub _fdsign @ cdecl _fdsign(float) msvcr120._fdsign
@ cdecl _fdtest(ptr) msvcr120._fdtest @ cdecl _fdtest(ptr) msvcr120._fdtest
@ cdecl _fflush_nolock(ptr) msvcr120._fflush_nolock @ cdecl _fflush_nolock(ptr) msvcr120._fflush_nolock
@ cdecl _fgetc_nolock(ptr) msvcr120._fgetc_nolock @ cdecl _fgetc_nolock(ptr) msvcr120._fgetc_nolock
...@@ -1257,7 +1257,7 @@ ...@@ -1257,7 +1257,7 @@
@ cdecl _jn(long double) msvcr120._jn @ cdecl _jn(long double) msvcr120._jn
@ cdecl _ldclass(double) msvcr120._ldclass @ cdecl _ldclass(double) msvcr120._ldclass
@ stub _ldpcomp @ stub _ldpcomp
@ stub _ldsign @ cdecl _ldsign(double) msvcr120._ldsign
@ cdecl _ldtest(ptr) msvcr120._ldtest @ cdecl _ldtest(ptr) msvcr120._ldtest
@ cdecl _lfind(ptr ptr ptr long ptr) msvcr120._lfind @ cdecl _lfind(ptr ptr ptr long ptr) msvcr120._lfind
@ stub _lfind_s @ stub _lfind_s
......
...@@ -2633,3 +2633,19 @@ double CDECL MSVCR120_fmax(double x, double y) ...@@ -2633,3 +2633,19 @@ double CDECL MSVCR120_fmax(double x, double y)
return signbit(x) ? y : x; return signbit(x) ? y : x;
return x<y ? 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;
}
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