Commit 811647df authored by Piotr Caban's avatar Piotr Caban Committed by Alexandre Julliard

msvcrt: Use _CRT_FLOAT and _CRT_DBL from public header.

parent eb6f79f9
......@@ -984,21 +984,6 @@ int create_positional_ctx_w(void*, const wchar_t*, __ms_va_list) DECLSPEC_HIDDEN
printf_arg arg_clbk_valist(void*, int, int, __ms_va_list*) DECLSPEC_HIDDEN;
printf_arg arg_clbk_positional(void*, int, int, __ms_va_list*) DECLSPEC_HIDDEN;
#define MSVCRT_FLT_MIN 1.175494351e-38F
#define MSVCRT_DBL_MIN 2.2250738585072014e-308
#define MSVCRT__OVERFLOW 3
#define MSVCRT__UNDERFLOW 4
typedef struct
{
float f;
} MSVCRT__CRT_FLOAT;
typedef struct
{
double x;
} MSVCRT__CRT_DOUBLE;
extern char* __cdecl __unDName(char *,const char*,int,malloc_func_t,free_func_t,unsigned short int);
/* __unDName/__unDNameEx flags */
......
......@@ -1092,7 +1092,7 @@ double CDECL MSVCRT__atof_l( const char *str, _locale_t locale)
/*********************************************************************
* _atoflt_l (MSVCRT.@)
*/
int CDECL MSVCRT__atoflt_l( MSVCRT__CRT_FLOAT *value, char *str, _locale_t locale)
int CDECL MSVCRT__atoflt_l(_CRT_FLOAT *value, char *str, _locale_t locale)
{
double d;
int err;
......@@ -1100,16 +1100,16 @@ int CDECL MSVCRT__atoflt_l( MSVCRT__CRT_FLOAT *value, char *str, _locale_t local
d = strtod_helper(str, NULL, locale, &err);
value->f = d;
if(isinf(value->f))
return MSVCRT__OVERFLOW;
if((d!=0 || err) && value->f>-MSVCRT_FLT_MIN && value->f<MSVCRT_FLT_MIN)
return MSVCRT__UNDERFLOW;
return _OVERFLOW;
if((d!=0 || err) && value->f>-FLT_MIN && value->f<FLT_MIN)
return _UNDERFLOW;
return 0;
}
/*********************************************************************
* _atoflt (MSVCR100.@)
*/
int CDECL MSVCRT__atoflt(MSVCRT__CRT_FLOAT *value, char *str)
int CDECL MSVCRT__atoflt(_CRT_FLOAT *value, char *str)
{
return MSVCRT__atoflt_l(value, str, NULL);
}
......@@ -1117,22 +1117,22 @@ int CDECL MSVCRT__atoflt(MSVCRT__CRT_FLOAT *value, char *str)
/*********************************************************************
* _atodbl_l (MSVCRT.@)
*/
int CDECL MSVCRT__atodbl_l(MSVCRT__CRT_DOUBLE *value, char *str, _locale_t locale)
int CDECL MSVCRT__atodbl_l(_CRT_DOUBLE *value, char *str, _locale_t locale)
{
int err;
value->x = strtod_helper(str, NULL, locale, &err);
if(isinf(value->x))
return MSVCRT__OVERFLOW;
if((value->x!=0 || err) && value->x>-MSVCRT_DBL_MIN && value->x<MSVCRT_DBL_MIN)
return MSVCRT__UNDERFLOW;
return _OVERFLOW;
if((value->x!=0 || err) && value->x>-DBL_MIN && value->x<DBL_MIN)
return _UNDERFLOW;
return 0;
}
/*********************************************************************
* _atodbl (MSVCRT.@)
*/
int CDECL MSVCRT__atodbl(MSVCRT__CRT_DOUBLE *value, char *str)
int CDECL MSVCRT__atodbl(_CRT_DOUBLE *value, char *str)
{
return MSVCRT__atodbl_l(value, str, NULL);
}
......@@ -1482,8 +1482,8 @@ int CDECL MSVCRT__atoldbl_l( MSVCRT__LDOUBLE *value, const char *str, _locale_t
char *endptr;
switch(__STRINGTOLD_L( value, &endptr, str, 0, locale ))
{
case 1: return MSVCRT__UNDERFLOW;
case 2: return MSVCRT__OVERFLOW;
case 1: return _UNDERFLOW;
case 2: return _OVERFLOW;
default: return 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