Don't define strtold and strtof on *BSD + uClibc

Don't define strtold and strtof on *BSD and uClibc as they are already
defined there since:

* 2001 (FreeBSD 4.4)
* 2009 (OpenBSD 4.5)
* 2009 (DragonFlyBSD)
* 2002 (uClibc)

See
http://lists.nongnu.org/archive/html/tinycc-devel/2011-07/msg00025.html
for a bit more details.
This commit is contained in:
Thomas Preud'homme 2011-07-15 18:13:56 +02:00 committed by Thomas Preud'homme
parent ab7ed48ee8
commit 2dd3fb103e

12
tcc.h
View File

@ -873,18 +873,6 @@ enum tcc_token {
#define strtof (float)strtod
#define strtoll (long long)strtol
#endif
#elif defined(TCC_UCLIBC) || defined(__FreeBSD__) \
|| defined(__FreeBSD_kernel__) || defined(__DragonFly__) \
|| defined(__OpenBSD__)
/* currently incorrect */
static inline long double strtold(const char *nptr, char **endptr)
{
return (long double)strtod(nptr, endptr);
}
static inline float strtof(const char *nptr, char **endptr)
{
return (float)strtod(nptr, endptr);
}
#else
/* XXX: need to define this to use them in non ISOC99 context */
extern float strtof (const char *__nptr, char **__endptr);