msvcr120: Implement the _dclass/_fdclass/_ldclass functions.

This commit is contained in:
Martin Storsjo 2014-12-09 08:43:07 +02:00 committed by Alexandre Julliard
parent bb89483397
commit 5f395ee8e6
3 changed files with 51 additions and 3 deletions

View File

@ -1104,7 +1104,7 @@
@ varargs _cwscanf_s(wstr) @ varargs _cwscanf_s(wstr)
@ varargs _cwscanf_s_l(wstr ptr) @ varargs _cwscanf_s_l(wstr ptr)
@ extern _daylight MSVCRT___daylight @ extern _daylight MSVCRT___daylight
@ stub _dclass @ cdecl _dclass(double) MSVCR120__dclass
@ cdecl _difftime32(long long) MSVCRT__difftime32 @ cdecl _difftime32(long long) MSVCRT__difftime32
@ cdecl _difftime64(long long) MSVCRT__difftime64 @ cdecl _difftime64(long long) MSVCRT__difftime64
@ stub _dosmaperr @ stub _dosmaperr
@ -1140,7 +1140,7 @@
@ cdecl _fcloseall() MSVCRT__fcloseall @ cdecl _fcloseall() MSVCRT__fcloseall
@ cdecl _fcvt(double long ptr ptr) MSVCRT__fcvt @ cdecl _fcvt(double long ptr ptr) MSVCRT__fcvt
@ cdecl _fcvt_s(ptr long double long ptr ptr) MSVCRT__fcvt_s @ cdecl _fcvt_s(ptr long double long ptr ptr) MSVCRT__fcvt_s
@ stub _fdclass @ cdecl _fdclass(float) MSVCR120__fdclass
@ cdecl _fdopen(long str) MSVCRT__fdopen @ cdecl _fdopen(long str) MSVCRT__fdopen
@ stub _fdpcomp @ stub _fdpcomp
@ stub _fdsign @ stub _fdsign
@ -1389,7 +1389,7 @@
@ cdecl _j1(double) MSVCRT__j1 @ cdecl _j1(double) MSVCRT__j1
@ cdecl _jn(long double) MSVCRT__jn @ cdecl _jn(long double) MSVCRT__jn
@ cdecl _kbhit() @ cdecl _kbhit()
@ stub _ldclass @ cdecl _ldclass(double) MSVCR120__ldclass
@ stub _ldpcomp @ stub _ldpcomp
@ stub _ldsign @ stub _ldsign
@ stub _ldtest @ stub _ldtest

View File

@ -2526,3 +2526,44 @@ LDOUBLE CDECL MSVCR120_truncl(LDOUBLE x)
{ {
return MSVCR120_trunc(x); return MSVCR120_trunc(x);
} }
/*********************************************************************
* _dclass (MSVCR120.@)
*/
short CDECL MSVCR120__dclass(double x)
{
switch (MSVCRT__fpclass(x)) {
case MSVCRT__FPCLASS_QNAN:
case MSVCRT__FPCLASS_SNAN:
return MSVCRT_FP_NAN;
case MSVCRT__FPCLASS_NINF:
case MSVCRT__FPCLASS_PINF:
return MSVCRT_FP_INFINITE;
case MSVCRT__FPCLASS_ND:
case MSVCRT__FPCLASS_PD:
return MSVCRT_FP_SUBNORMAL;
case MSVCRT__FPCLASS_NN:
case MSVCRT__FPCLASS_PN:
default:
return MSVCRT_FP_NORMAL;
case MSVCRT__FPCLASS_NZ:
case MSVCRT__FPCLASS_PZ:
return MSVCRT_FP_ZERO;
}
}
/*********************************************************************
* _fdclass (MSVCR120.@)
*/
short CDECL MSVCR120__fdclass(float x)
{
return MSVCR120__dclass(x);
}
/*********************************************************************
* _ldclass (MSVCR120.@)
*/
short CDECL MSVCR120__ldclass(LDOUBLE x)
{
return MSVCR120__dclass(x);
}

View File

@ -824,6 +824,13 @@ struct MSVCRT__stat64 {
#define MSVCRT__FPCLASS_PN 0x0100 /* Positive Normal */ #define MSVCRT__FPCLASS_PN 0x0100 /* Positive Normal */
#define MSVCRT__FPCLASS_PINF 0x0200 /* Positive Infinity */ #define MSVCRT__FPCLASS_PINF 0x0200 /* Positive Infinity */
/* fpclassify constants */
#define MSVCRT_FP_INFINITE 1
#define MSVCRT_FP_NAN 2
#define MSVCRT_FP_NORMAL -1
#define MSVCRT_FP_SUBNORMAL -2
#define MSVCRT_FP_ZERO 0
#define MSVCRT__MCW_EM 0x0008001f #define MSVCRT__MCW_EM 0x0008001f
#define MSVCRT__MCW_IC 0x00040000 #define MSVCRT__MCW_IC 0x00040000
#define MSVCRT__MCW_RC 0x00000300 #define MSVCRT__MCW_RC 0x00000300