From dc3db854dca42116ea1ac8d85904110ec03ebdb6 Mon Sep 17 00:00:00 2001 From: Michael Wu Date: Tue, 25 May 2010 15:21:18 -0700 Subject: [PATCH] Bug 565089 - Allow cairo to build on Android. r=jmuizelaar,ted --- configure.in | 5 ++++- gfx/cairo/cairo/src/cairo-output-stream.c | 5 +++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/configure.in b/configure.in index 9184b57a3d03..bb3ec51ba106 100644 --- a/configure.in +++ b/configure.in @@ -4563,7 +4563,9 @@ AC_CACHE_CHECK(for LC_MESSAGES, ac_cv_i18n_lc_messages=no)]) if test "$ac_cv_i18n_lc_messages" = yes; then AC_DEFINE(HAVE_I18N_LC_MESSAGES) -fi +fi + +AC_HAVE_FUNCS(localeconv) fi # SKIP_COMPILER_CHECKS @@ -4610,6 +4612,7 @@ if test -n "$SKIP_COMPILER_CHECKS"; then dnl Windows has malloc.h AC_DEFINE(MALLOC_H, []) AC_DEFINE(HAVE_FORCEINLINE) + AC_DEFINE(HAVE_LOCALECONV) fi # SKIP_COMPILER_CHECKS dnl ======================================================== diff --git a/gfx/cairo/cairo/src/cairo-output-stream.c b/gfx/cairo/cairo/src/cairo-output-stream.c index 20f676c9a0e0..8616e4c2b1b3 100644 --- a/gfx/cairo/cairo/src/cairo-output-stream.c +++ b/gfx/cairo/cairo/src/cairo-output-stream.c @@ -311,9 +311,14 @@ _cairo_dtostr (char *buffer, size_t size, double d, cairo_bool_t limited_precisi if (d == 0.0) d = 0.0; +#ifdef HAVE_LOCALECONV 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);