From: Bruno Haible Date: Mon, 2 Jan 2023 07:33:10 +0000 (+0100) Subject: libtextstyle: Fix compilation error on Android. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d604eb0c90c5b189aa481050205ceb300d0d473b;p=thirdparty%2Fgettext.git 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. --- 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 ]]) else LIBGLIB_H= fi