diff --git a/src/util/strtod.c b/src/util/strtod.c index ea7d395e2d..8f6604b5ab 100644 --- a/src/util/strtod.c +++ b/src/util/strtod.c @@ -28,11 +28,8 @@ #ifdef _GNU_SOURCE #include -#ifdef HAVE_XLOCALE_H -#include static locale_t loc; #endif -#endif #include "strtod.h" @@ -40,7 +37,7 @@ static locale_t loc; void _mesa_locale_init(void) { -#if defined(_GNU_SOURCE) && defined(HAVE_XLOCALE_H) +#if defined(_GNU_SOURCE) loc = newlocale(LC_CTYPE_MASK, "C", NULL); #endif } @@ -48,7 +45,7 @@ _mesa_locale_init(void) void _mesa_locale_fini(void) { -#if defined(_GNU_SOURCE) && defined(HAVE_XLOCALE_H) +#if defined(_GNU_SOURCE) freelocale(loc); #endif } @@ -60,7 +57,7 @@ _mesa_locale_fini(void) double _mesa_strtod(const char *s, char **end) { -#if defined(_GNU_SOURCE) && defined(HAVE_XLOCALE_H) +#if defined(_GNU_SOURCE) return strtod_l(s, end, loc); #else return strtod(s, end); @@ -75,7 +72,7 @@ _mesa_strtod(const char *s, char **end) float _mesa_strtof(const char *s, char **end) { -#if defined(_GNU_SOURCE) && defined(HAVE_XLOCALE_H) +#if defined(_GNU_SOURCE) return strtof_l(s, end, loc); #elif defined(HAVE_STRTOF) return strtof(s, end);