Building for Android

Marc Glisse marc.glisse at inria.fr
Wed Jun 26 19:59:32 CEST 2013


On Wed, 26 Jun 2013, Torbjorn Granlund wrote:

> Marc Glisse <marc.glisse at inria.fr> writes:
>
>  On Mon, 17 Jun 2013, Marc Glisse wrote:
>
>  > Probably just a configure test to detect platforms without
>  > decimal_point in lconv.
>
>  Would the attached work / make sense?
>
> The AC_CHECK_MEMBER test is in the C realm.  Aren't we in C++ land here?

No, this is (mostly) C code. lconv.decimal_point is used in C, and in C++ 
we only use it to pass the C code what it expects (I am a bit surprised we 
have code to convert the C++ point to the C point in case they disagree on 
the locale...).

I am not sure how GMP_DECIMAL_POINT works on android. I don't think they 
have nl_langinfo and, since they have a placeholder localeconv, gmp-impl.h 
should end up using it, but apparently it doesn't. Maybe the configure 
test doesn't link and thus decides that localeconv is absent? That would 
simplify things as my new macro becomes unnecessary.

In any case, replacing the calls to localeconv with GMP_DECIMAL_POINT in 
the C++ code makes it more uniform with the C code.

> I feel out of depth in this area.

So do I...

> Does Android define struct lconv but has its own non-standard fields?

#if 1 /* MISSING FROM BIONIC - DEFINED TO MAKE libstdc++-v3 happy */
struct lconv { };
struct lconv *localeconv(void);
#endif /* MISSING */

> How can they then expect software to work?

No idea. A google search shows that a number of software don't.

-- 
Marc Glisse


More information about the gmp-discuss mailing list