esac
fi
+AC_CHECK_HEADER([xlocale.h], [DEFINES="$DEFINES -DHAVE_XLOCALE_H"])
+AC_CHECK_FUNC([strtof], [DEFINES="$DEFINES -DHAVE_STRTOF"])
+
dnl Check to see if dlopen is in default libraries (like Solaris, which
dnl has it in libc), or if libdl is needed to get it.
AC_CHECK_FUNC([dlopen], [DEFINES="$DEFINES -DHAVE_DLOPEN"],
cppdefines += ['HAVE_ALIAS']
else:
cppdefines += ['GLX_ALIAS_UNSUPPORTED']
+
+ if env['platform'] in ('linux', 'darwin'):
+ cppdefines += ['HAVE_XLOCALE_H']
+
if env['platform'] == 'haiku':
cppdefines += [
'HAVE_PTHREAD',
#ifdef _GNU_SOURCE
#include <locale.h>
-#ifdef __APPLE__
+#ifdef HAVE_XLOCALE_H
#include <xlocale.h>
#endif
#endif
double
_mesa_strtod(const char *s, char **end)
{
-#if defined(_GNU_SOURCE) && !defined(__CYGWIN__) && !defined(__FreeBSD__) && \
- !defined(ANDROID) && !defined(__HAIKU__) && !defined(__UCLIBC__) && \
- !defined(__NetBSD__)
+#if defined(_GNU_SOURCE) && defined(HAVE_XLOCALE_H)
static locale_t loc = NULL;
if (!loc) {
loc = newlocale(LC_CTYPE_MASK, "C", NULL);
float
_mesa_strtof(const char *s, char **end)
{
-#if defined(_GNU_SOURCE) && !defined(__CYGWIN__) && !defined(__FreeBSD__) && \
- !defined(ANDROID) && !defined(__HAIKU__) && !defined(__UCLIBC__) && \
- !defined(__NetBSD__)
+#if defined(_GNU_SOURCE) && defined(HAVE_XLOCALE_H)
static locale_t loc = NULL;
if (!loc) {
loc = newlocale(LC_CTYPE_MASK, "C", NULL);
}
return strtof_l(s, end, loc);
-#elif defined(_ISOC99_SOURCE) || (defined(_XOPEN_SOURCE) && _XOPEN_SOURCE >= 600)
+#elif defined(HAVE_STRTOF)
return strtof(s, end);
#else
return (float) strtod(s, end);