mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-11-30 04:43:50 +01:00
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:
@@ -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
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user