MinGW: Use actually working strtold.

Like their whole runtime in general, the MSVC version does
not handle 80 bit reals/long doubles.
This commit is contained in:
David Nadlinger
2013-05-29 22:18:42 +02:00
parent bf4df5fcc4
commit 0b5989c51a
4 changed files with 27 additions and 4 deletions
+23
View File
@@ -348,6 +348,14 @@ int Port::stricmp(const char *s1, const char *s2)
return ::stricmp(s1, s2);
}
// See vcbuild/strtold.c.
longdouble strtold(const char *p, char **endp);
longdouble Port::strtold(const char *p, char **endp)
{
return ::strtold(p, endp);
}
#endif
#if __MINGW32__
@@ -527,6 +535,11 @@ int Port::stricmp(const char *s1, const char *s2)
return result;
}
longdouble Port::strtold(const char *p, char **endp)
{
return ::__mingw_strtold(p, endp);
}
#endif
#if linux || __APPLE__ || __FreeBSD__ || __OpenBSD__ || __HAIKU__
@@ -765,6 +778,11 @@ int Port::stricmp(const char *s1, const char *s2)
return result;
}
longdouble Port::strtold(const char *p, char **endp)
{
return ::strtold(p, endp);
}
#endif
#if __sun
@@ -910,4 +928,9 @@ char *Port::strupr(char *s)
return t;
}
longdouble Port::strtold(const char *p, char **endp)
{
return ::strtold(p, endp);
}
#endif
+2 -2
View File
@@ -19,8 +19,6 @@
#if _MSC_VER
#include <float.h> // for _isnan
#include <malloc.h> // for alloca
// According to VC 8.0 docs, long double is the same as double
longdouble strtold(const char *p,char **endp);
#define strtof strtod
#define isnan _isnan
@@ -72,6 +70,8 @@ struct Port
static int memicmp(const char *s1, const char *s2, int n);
static int stricmp(const char *s1, const char *s2);
static longdouble strtold(const char *p, char **endp);
};
#endif