From 03525d9223166d969819dda0d2d6f9e8fe4bc934 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Wed, 22 Aug 2012 15:39:32 +0200 Subject: [PATCH 3/3] Port to Android --- src/cairo-output-stream.c | 7 +++++++ util/cairo-trace/trace.c | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/src/cairo-output-stream.c b/src/cairo-output-stream.c index 0adda36..8b61fb3 100644 --- a/src/cairo-output-stream.c +++ b/src/cairo-output-stream.c @@ -301,7 +301,9 @@ _cairo_output_stream_write_hex_string (cairo_output_stream_t *stream, static void _cairo_dtostr (char *buffer, size_t size, double d, cairo_bool_t limited_precision) { +#ifndef __BIONIC__ struct lconv *locale_data; +#endif const char *decimal_point; int decimal_point_len; char *p; @@ -312,9 +314,14 @@ _cairo_dtostr (char *buffer, size_t size, double d, cairo_bool_t limited_precisi 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 assert (decimal_point_len != 0); diff --git a/util/cairo-trace/trace.c b/util/cairo-trace/trace.c index acdde93..51ede83 100644 --- a/util/cairo-trace/trace.c +++ b/util/cairo-trace/trace.c @@ -521,7 +521,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; @@ -532,9 +534,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 -- 1.8.4