msvcp90: Add std_Ctraits::Isnan implementation.

This commit is contained in:
YongHao Hu 2014-11-08 10:15:21 +08:00 committed by Alexandre Julliard
parent 0e21f80b4b
commit 6fe4d9e71b
6 changed files with 69 additions and 12 deletions

View File

@ -2103,9 +2103,9 @@
@ stub ?_Isinf@?$_Ctraits@M@std@@SA_NM@Z
@ stub ?_Isinf@?$_Ctraits@N@std@@SA_NN@Z
@ stub ?_Isinf@?$_Ctraits@O@std@@SA_NO@Z
@ stub ?_Isnan@?$_Ctraits@M@std@@SA_NM@Z
@ stub ?_Isnan@?$_Ctraits@N@std@@SA_NN@Z
@ stub ?_Isnan@?$_Ctraits@O@std@@SA_NO@Z
@ cdecl ?_Isnan@?$_Ctraits@M@std@@SA_NM@Z(float) std_Ctraits_float__Isnan
@ cdecl ?_Isnan@?$_Ctraits@N@std@@SA_NN@Z(double) std_Ctraits_double__Isnan
@ cdecl ?_Isnan@?$_Ctraits@O@std@@SA_NO@Z(double) std_Ctraits_long_double__Isnan
@ stub -arch=win32 ?_Loc_atexit@std@@YA_NP6AXXZ@Z
@ stub -arch=win32 ?_Makpat@?$_Mpunct@D@std@@AAEXAAUpattern@money_base@2@III@Z
@ stub -arch=win64 ?_Makpat@?$_Mpunct@D@std@@AEAAXAEAUpattern@money_base@2@III@Z

View File

@ -2300,9 +2300,9 @@
@ stub ?_Isinf@?$_Ctraits@M@std@@SA_NM@Z
@ stub ?_Isinf@?$_Ctraits@N@std@@SA_NN@Z
@ stub ?_Isinf@?$_Ctraits@O@std@@SA_NO@Z
@ stub ?_Isnan@?$_Ctraits@M@std@@SA_NM@Z
@ stub ?_Isnan@?$_Ctraits@N@std@@SA_NN@Z
@ stub ?_Isnan@?$_Ctraits@O@std@@SA_NO@Z
@ cdecl ?_Isnan@?$_Ctraits@M@std@@SA_NM@Z(float) std_Ctraits_float__Isnan
@ cdecl ?_Isnan@?$_Ctraits@N@std@@SA_NN@Z(double) std_Ctraits_double__Isnan
@ cdecl ?_Isnan@?$_Ctraits@O@std@@SA_NO@Z(double) std_Ctraits_long_double__Isnan
@ thiscall -arch=win32 ?_Lock@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEXXZ(ptr) basic_streambuf_char__Lock
@ cdecl -arch=win64 ?_Lock@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAAXXZ(ptr) basic_streambuf_char__Lock
@ thiscall -arch=win32 ?_Lock@?$basic_streambuf@GU?$char_traits@G@std@@@std@@QAEXXZ(ptr) basic_streambuf_wchar__Lock

View File

@ -2557,9 +2557,9 @@
@ stub ?_Isinf@?$_Ctraits@M@std@@SA_NM@Z
@ stub ?_Isinf@?$_Ctraits@N@std@@SA_NN@Z
@ stub ?_Isinf@?$_Ctraits@O@std@@SA_NO@Z
@ stub ?_Isnan@?$_Ctraits@M@std@@SA_NM@Z
@ stub ?_Isnan@?$_Ctraits@N@std@@SA_NN@Z
@ stub ?_Isnan@?$_Ctraits@O@std@@SA_NO@Z
@ cdecl ?_Isnan@?$_Ctraits@M@std@@SA_NM@Z(float) std_Ctraits_float__Isnan
@ cdecl ?_Isnan@?$_Ctraits@N@std@@SA_NN@Z(double) std_Ctraits_double__Isnan
@ cdecl ?_Isnan@?$_Ctraits@O@std@@SA_NO@Z(double) std_Ctraits_long_double__Isnan
@ cdecl -arch=win32 ?_Locimp_Addfac@_Locimp@locale@std@@CAXPAV123@PAVfacet@23@I@Z(ptr ptr long) locale__Locimp__Locimp_Addfac
@ cdecl -arch=win64 ?_Locimp_Addfac@_Locimp@locale@std@@CAXPEAV123@PEAVfacet@23@_K@Z(ptr ptr long) locale__Locimp__Locimp_Addfac
@ cdecl -arch=win32 ?_Locimp_ctor@_Locimp@locale@std@@CAXPAV123@ABV123@@Z(ptr ptr) locale__Locimp__Locimp_ctor

View File

@ -815,6 +815,15 @@ std_Ctraits * __thiscall std_Ctraits_op_assign( std_Ctraits *this, std_Ctraits *
return this;
}
/* ?_Isnan@?$_Ctraits@M@std@@SA_NM@Z -> public: static bool __cdecl std::_Ctraits<float>::_Isnan(float) */
BOOLEAN __cdecl std_Ctraits_float__Isnan( float x ) { return _isnan(x); }
/* ?_Isnan@?$_Ctraits@N@std@@SA_NN@Z -> public: static bool __cdecl std::_Ctraits<double>::_Isnan(double) */
BOOLEAN __cdecl std_Ctraits_double__Isnan( double x ) { return _isnan(x); }
/* ?_Isnan@?$_Ctraits@O@std@@SA_NO@Z -> public: static bool __cdecl std::_Ctraits<long double>::_Isnan(long double) */
BOOLEAN __cdecl std_Ctraits_long_double__Isnan( LDOUBLE x ) { return _isnan(x); }
/* ?atan2@?$_Ctraits@M@std@@SAMMM@Z -> public: static float __cdecl std::_Ctraits<float>::atan2(float,float) */
float __cdecl std_Ctraits_float_atan2( float y, float x ) { return atan2f( y, x ); }

View File

@ -2878,9 +2878,9 @@
@ stub ?_Isinf@?$_Ctraits@M@std@@SA_NM@Z
@ stub ?_Isinf@?$_Ctraits@N@std@@SA_NN@Z
@ stub ?_Isinf@?$_Ctraits@O@std@@SA_NO@Z
@ stub ?_Isnan@?$_Ctraits@M@std@@SA_NM@Z
@ stub ?_Isnan@?$_Ctraits@N@std@@SA_NN@Z
@ stub ?_Isnan@?$_Ctraits@O@std@@SA_NO@Z
@ cdecl ?_Isnan@?$_Ctraits@M@std@@SA_NM@Z(float) std_Ctraits_float__Isnan
@ cdecl ?_Isnan@?$_Ctraits@N@std@@SA_NN@Z(double) std_Ctraits_double__Isnan
@ cdecl ?_Isnan@?$_Ctraits@O@std@@SA_NO@Z(double) std_Ctraits_long_double__Isnan
@ cdecl -arch=win32 ?_Locimp_Addfac@_Locimp@locale@std@@CAXPAV123@PAVfacet@23@I@Z(ptr ptr long) locale__Locimp__Locimp_Addfac
@ cdecl -arch=win64 ?_Locimp_Addfac@_Locimp@locale@std@@CAXPEAV123@PEAVfacet@23@_K@Z(ptr ptr long) locale__Locimp__Locimp_Addfac
@ cdecl -arch=win32 ?_Locimp_ctor@_Locimp@locale@std@@CAXPAV123@ABV123@@Z(ptr ptr) locale__Locimp__Locimp_ctor

View File

@ -19,6 +19,7 @@
#include <stdio.h>
#include <locale.h>
#include <wctype.h>
#include <math.h>
#include <float.h>
#include <errno.h>
@ -26,6 +27,8 @@
#include <winbase.h>
#include "wine/test.h"
typedef double LDOUBLE; /* long double is just a double */
typedef struct {
LCID handle;
unsigned page;
@ -110,6 +113,10 @@ static void (__thiscall *p_basic_ostringstream_char_dtor)(/*basic_ostringstream_
static void (__thiscall *p_basic_ostringstream_char_vbase_dtor)(/*basic_ostringstream_char*/void*);
static void (__thiscall *p_basic_ios_char_dtor)(/*basic_ios_char*/void*);
static BOOL (__cdecl *p_std_Ctraits_float__Isnan)(float);
static BOOL (__cdecl *p_std_Ctraits_double__Isnan)(double);
static BOOL (__cdecl *p_std_Ctraits_long_double__Isnan)(LDOUBLE);
static complex_float* (__thiscall *p_complex_float_ctor)(complex_float*, const float*, const float*);
static complex_float* (__cdecl *p_complex_float_add)(complex_float*, const complex_float*, const complex_float*);
static complex_float* (__cdecl *p_complex_float_div)(complex_float*, const complex_float*, const complex_float*);
@ -216,6 +223,11 @@ static BOOL init(void)
SET(p_wctrans, "wctrans");
SET(p_towctrans, "towctrans");
SET(basic_ostringstream_char_vbtable, "??_8?$basic_ostringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@7B@");
SET(p_std_Ctraits_float__Isnan, "?_Isnan@?$_Ctraits@M@std@@SA_NM@Z");
SET(p_std_Ctraits_double__Isnan, "?_Isnan@?$_Ctraits@N@std@@SA_NN@Z");
SET(p_std_Ctraits_long_double__Isnan, "?_Isnan@?$_Ctraits@O@std@@SA_NO@Z");
if(sizeof(void*) == 8) { /* 64-bit initialization */
SET(p_char_assign, "?assign@?$char_traits@D@std@@SAXAEADAEBD@Z");
SET(p_wchar_assign, "?assign@?$char_traits@_W@std@@SAXAEA_WAEB_W@Z");
@ -688,6 +700,41 @@ static BOOL almost_eq(float f1, float f2)
return f1 < 0.0001;
}
static void test_Ctraits_math_functions(void)
{
BYTE ret;
ret = p_std_Ctraits_float__Isnan(0.0);
ok(ret == FALSE, "ret = %d\n", ret);
ret = p_std_Ctraits_float__Isnan(0.0 / 0.0);
ok(ret == TRUE, "ret = %d\n", ret);
ret = p_std_Ctraits_float__Isnan(1.0 / 0.0);
ok(ret == FALSE, "ret = %d\n", ret);
ret = p_std_Ctraits_float__Isnan(-1.0 / 0.0);
ok(ret == FALSE, "ret = %d\n", ret);
ret = p_std_Ctraits_float__Isnan(log(-1.0));
ok(ret == TRUE, "ret = %d\n", ret);
ret = p_std_Ctraits_float__Isnan(sqrt(-1.0));
ok(ret == TRUE, "ret = %d\n", ret);
ret = p_std_Ctraits_double__Isnan(3.14159 / 0.0);
ok(ret == FALSE, "ret = %d\n", ret);
ret = p_std_Ctraits_double__Isnan(log(-3.14159));
ok(ret == TRUE, "ret = %d\n", ret);
ret = p_std_Ctraits_long_double__Isnan(3.14159 / 0.0);
ok(ret == FALSE, "ret = %d\n", ret);
ret = p_std_Ctraits_long_double__Isnan(sqrt(-3.14159));
ok(ret == TRUE, "ret = %d\n", ret);
}
static void test_complex(void)
{
complex_float c1, c2, c3;
@ -935,6 +982,7 @@ START_TEST(misc)
test_virtual_call();
test_virtual_base_dtors();
test_allocator_char();
test_Ctraits_math_functions();
test_complex();
ok(!invalid_parameter, "invalid_parameter_handler was invoked too many times\n");