Bug 70492

Summary: Fix compilation with Android's bionic libc
Product: cairo Reporter: Sebastian Dröge (slomo) <slomo>
Component: generalAssignee: Chris Wilson <chris>
Status: RESOLVED FIXED QA Contact: cairo-bugs mailing list <cairo-bugs>
Severity: normal    
Priority: medium CC: bryce, tal.liron
Version: 1.12.16   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments: cairo-android.patch
0001-Fix-compilation-with-Android-s-bionic-libc.patch
Fix compilation with bionic libc

Description Sebastian Dröge (slomo) 2013-10-15 10:54:46 UTC
Created attachment 87664 [details]
cairo-android.patch

Hi,

attached patch fixes the build of cairo with Android's bionic libc. Should be pretty self-explanatory.
Comment 1 Sebastian Dröge (slomo) 2013-10-15 11:06:48 UTC
Created attachment 87665 [details] [review]
0001-Fix-compilation-with-Android-s-bionic-libc.patch

And now actually make it complete for cairo 1.12.16.
Comment 2 Bill Spitzak 2013-10-15 16:33:59 UTC
On 10/15/2013 04:06 AM, bugzilla-daemon@freedesktop.org wrote:
> Sebastian Dröge (slomo) <mailto:slomo@circular-chaos.org> changed bug
> 70492 <https://bugs.freedesktop.org/show_bug.cgi?id=70492>
> What 	Removed 	Added
> Attachment #87664 [details] is obsolete 		1
>
> *Comment # 1 <https://bugs.freedesktop.org/show_bug.cgi?id=70492#c1> on
> bug 70492 <https://bugs.freedesktop.org/show_bug.cgi?id=70492> from
> Sebastian Dröge (slomo) <mailto:slomo@circular-chaos.org> *
>
> Createdattachment 87665  <attachment.cgi?id=87665>  [details]  <attachment.cgi?id=87665&action=edit>  [review]  <page.cgi?id=splinter.html&bug=70492&attachment=87665>
> 0001-Fix-compilation-with-Android-s-bionic-libc.patch
>
> And now actually make it complete for cairo 1.12.16.
>
> ------------------------------------------------------------------------
> You are receiving this mail because:
>
>   * You are watching the QA Contact of the bug.
>

I think it is pretty alarming that parsing of a matrix from a 
configuration file depends on the locale!
Comment 3 Uli Schlachter 2014-03-23 15:29:18 UTC
*** Bug 76512 has been marked as a duplicate of this bug. ***
Comment 4 Adrian Johnson 2014-03-24 08:43:44 UTC
Created attachment 96275 [details] [review]
Fix compilation with bionic libc

I would prefer something like this patch instead of sprinkling #ifdefs throughout the code.
Comment 5 Bryce Harrington 2014-06-05 23:31:18 UTC
This could be done a bit more concisely I think:

+const char *
+cairo_get_locale_decimal_point (void)
+{
+#ifdef __BIONIC__
+    return '.';
+#else
+    struct lconv *locale_data;
+
+    locale_data = localeconv ();
+    return locale_data->decimal_point;
+#endif
+}

Also the #include <locale.h> should be wrapped in an #ifndef __BIONIC__ to avoid problems, and since it won't be needed there.
Comment 6 Bryce Harrington 2014-09-23 19:05:08 UTC
I've applied those changes and merged the patch.  Thanks!

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.