From 169c625ba54c2e7509a19fe19202e0e82746686c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Tue, 15 Oct 2013 13:05:27 +0200 Subject: [PATCH 1/2] Fix compilation with Android's bionic libc It does not properly implement localeconv() and the decimal point in struct lconv. https://bugs.freedesktop.org/show_bug.cgi?id=70492 --- util/cairo-trace/trace.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/util/cairo-trace/trace.c b/util/cairo-trace/trace.c index d5d7668..23db778 100644 --- a/util/cairo-trace/trace.c +++ b/util/cairo-trace/trace.c @@ -527,7 +527,9 @@ _fini_trace (void) static void _trace_dtostr (char *buffer, size_t size, double d) { +#ifndef __BIONIC__ struct lconv *locale_data; +#endif const char *decimal_point; int decimal_point_len; char *p; @@ -538,9 +540,14 @@ _trace_dtostr (char *buffer, size_t size, double d) if (d == 0.0) d = 0.0; +#ifndef __BIONIC__ locale_data = localeconv (); decimal_point = locale_data->decimal_point; decimal_point_len = strlen (decimal_point); +#else + decimal_point = "."; + decimal_point_len = 1; +#endif /* Using "%f" to print numbers less than 0.1 will result in * reduced precision due to the default 6 digits after the -- 2.1.0