const guint16 * const g_ascii_table = ascii_table_data;
-#ifdef HAVE_NEWLOCALE
+#if defined (HAVE_NEWLOCALE) && \
+ defined (HAVE_USELOCALE) && \
+ defined (HAVE_STRTOD_L) && \
+ defined (HAVE_STRTOULL_L) && \
+ defined (HAVE_STRTOLL_L)
+#define USE_XLOCALE 1
+#endif
+
+#ifdef USE_XLOCALE
static locale_t
get_C_locale (void)
{
g_ascii_strtod (const gchar *nptr,
gchar **endptr)
{
-#ifdef HAVE_STRTOD_L
+#ifdef USE_XLOCALE
g_return_val_if_fail (nptr != NULL, 0);
const gchar *format,
gdouble d)
{
-#ifdef HAVE_USELOCALE
+#ifdef USE_XLOCALE
locale_t old_locale;
old_locale = uselocale (get_C_locale ());
#define TOUPPER(c) (ISLOWER (c) ? (c) - 'a' + 'A' : (c))
#define TOLOWER(c) (ISUPPER (c) ? (c) - 'A' + 'a' : (c))
-#if !defined(HAVE_STRTOLL_L) || !defined(HAVE_STRTOULL_L)
+#ifndef USE_XLOCALE
static guint64
g_parse_long_long (const gchar *nptr,
}
return 0;
}
-#endif
+#endif /* !USE_XLOCALE */
/**
* g_ascii_strtoull:
gchar **endptr,
guint base)
{
-#ifdef HAVE_STRTOULL_L
+#ifdef USE_XLOCALE
return strtoull_l (nptr, endptr, base, get_C_locale ());
#else
gboolean negative;
gchar **endptr,
guint base)
{
-#ifdef HAVE_STRTOLL_L
+#ifdef USE_XLOCALE
return strtoll_l (nptr, endptr, base, get_C_locale ());
#else
gboolean negative;