summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2023-01-02 08:33:10 +0100
committerBruno Haible <bruno@clisp.org>2023-01-02 08:33:10 +0100
commitd604eb0c90c5b189aa481050205ceb300d0d473b (patch)
treedf449d39b4f5015449fa84527414cd5294ceeda1
parentb8fc039e4266570f5af5ee1c2cd201369a766f1e (diff)
downloadgettext-d604eb0c90c5b189aa481050205ceb300d0d473b.tar.gz
libtextstyle: Fix compilation error on Android.
* libtextstyle/gnulib-local/m4/libglib.m4 (gl_LIBGLIB): Test whether struct lconv has a 'decimal_point' field. * libtextstyle/gnulib-local/lib/glib/gstrfuncs.c (g_ascii_strtod, g_ascii_formatd): If struct lconv does not have a 'decimal_point' field, use "." instead.
-rw-r--r--libtextstyle/gnulib-local/lib/glib/gstrfuncs.c10
-rw-r--r--libtextstyle/gnulib-local/m4/libglib.m46
2 files changed, 13 insertions, 3 deletions
diff --git a/libtextstyle/gnulib-local/lib/glib/gstrfuncs.c b/libtextstyle/gnulib-local/lib/glib/gstrfuncs.c
index 6ec6c6932..75a87e5ee 100644
--- a/libtextstyle/gnulib-local/lib/glib/gstrfuncs.c
+++ b/libtextstyle/gnulib-local/lib/glib/gstrfuncs.c
@@ -1,5 +1,5 @@
/* GLIB - Library of useful routines for C programming
- * Copyright (C) 2006-2019 Free Software Foundation, Inc.
+ * Copyright (C) 2006-2023 Free Software Foundation, Inc.
*
* This file is not part of the GNU gettext program, but is used with
* GNU gettext.
@@ -372,7 +372,11 @@ g_ascii_strtod (const gchar *nptr,
fail_pos = NULL;
locale_data = localeconv ();
+#if HAVE_STRUCT_LCONV_DECIMAL_POINT
decimal_point = locale_data->decimal_point;
+#else
+ decimal_point = ".";
+#endif
decimal_point_len = strlen (decimal_point);
g_assert (decimal_point_len != 0);
@@ -588,7 +592,11 @@ g_ascii_formatd (gchar *buffer,
_g_snprintf (buffer, buf_len, format, d);
locale_data = localeconv ();
+#if HAVE_STRUCT_LCONV_DECIMAL_POINT
decimal_point = locale_data->decimal_point;
+#else
+ decimal_point = ".";
+#endif
decimal_point_len = strlen (decimal_point);
g_assert (decimal_point_len != 0);
diff --git a/libtextstyle/gnulib-local/m4/libglib.m4 b/libtextstyle/gnulib-local/m4/libglib.m4
index 7ee5029e0..dbc9eb82a 100644
--- a/libtextstyle/gnulib-local/m4/libglib.m4
+++ b/libtextstyle/gnulib-local/m4/libglib.m4
@@ -1,5 +1,5 @@
-# libglib.m4 serial 6
-dnl Copyright (C) 2006-2007, 2019-2020 Free Software Foundation, Inc.
+# libglib.m4 serial 7
+dnl Copyright (C) 2006-2007, 2019-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -127,6 +127,8 @@ AC_DEFUN([gl_LIBGLIB],
AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
AC_CHECK_HEADERS([unistd.h])
dnl Don't bother checking for pthread.h and other multithread facilities.
+ AC_CHECK_MEMBERS([struct lconv.decimal_point], [], [],
+ [[#include <locale.h>]])
else
LIBGLIB_H=
fi