Commit a7ca2ba7 authored by Andreas Mohr's avatar Andreas Mohr Committed by Alexandre Julliard

NetBSD 1.5 is lacking ecvt, fcvt, gcvt for crtdll.

parent 22c80a2e
......@@ -781,6 +781,7 @@ AC_CHECK_FUNCS(\
__libc_fork \
_lwp_create \
clone \
ecvt \
finite \
fpclass \
getnetbyaddr \
......
......@@ -178,6 +178,9 @@
/* Define if you have the dlopen function. */
#undef HAVE_DLOPEN
/* Define if you have the ecvt function. */
#undef HAVE_ECVT
/* Define if you have the finite function. */
#undef HAVE_FINITE
......
......@@ -558,3 +558,49 @@ unsigned short* wine_rewrite_s4tos2(const wchar_t* str4 )
return str2;
}
#ifndef HAVE_ECVT
/*
* NetBSD 1.5 doesn't have ecvt, fcvt, gcvt. We just check for ecvt, though.
* Fix/verify these implementations !
*/
/***********************************************************************
* ecvt
*/
char *ecvt (double number, int ndigits, int *decpt, int *sign)
{
static buf[40]; /* ought to be enough */
char *dec;
sprintf(buf, "%.*e", ndigits /* FIXME wrong */, number);
*sign = (number < 0);
dec = strchr(buf, '.');
*decpt = (dec) ? (int)dec - (int)buf : -1;
return buf;
}
/***********************************************************************
* fcvt
*/
char *fcvt (double number, int ndigits, int *decpt, int *sign)
{
static buf[40]; /* ought to be enough */
char *dec;
sprintf(buf, "%.*e", ndigits, number);
*sign = (number < 0);
dec = strchr(buf, '.');
*decpt = (dec) ? (int)dec - (int)buf : -1;
return buf;
}
/***********************************************************************
* gcvt
*
* FIXME: uses both E and F.
*/
char *gcvt (double number, size_t ndigit, char *buff)
{
sprintf(buff, "%.*E", ndigit, number);
return buff;
}
#endif /* HAVE_ECVT */
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