struct lconv from local.h don't contain decimal_point

1,130 views
Skip to first unread message

Xavier Bigand

unread,
May 10, 2010, 10:39:10 AM5/10/10
to android-ndk
Hi,

I am trying to compile lua with my engine but the member decimal_point
isn't present in the lconv struct.

For the moment I force the result as '.' character. Is their a way to
get a fixed local.h?

--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To post to this group, send email to andro...@googlegroups.com.
To unsubscribe from this group, send email to android-ndk...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/android-ndk?hl=en.

Dianne Hackborn

unread,
May 10, 2010, 6:16:27 PM5/10/10
to andro...@googlegroups.com
Bionic doesn't really support c locale; you should use the Java APIs to get this kind of information.
--
Dianne Hackborn
Android framework engineer
hac...@android.com

Note: please don't send private questions to me, as I don't have time to provide private support, and so won't reply to such e-mails.  All such questions should be posted on public forums, where I and others can see and answer them.

Angus Lees

unread,
May 10, 2010, 7:27:29 PM5/10/10
to andro...@googlegroups.com
There are various other fields missing from Android versions of C structs too (pw_gecos, etc).

If lua uses autoconf, it's quite easy to add AC_CHECK_MEMBERS checks for the missing struct members and #ifdef out the offending code.  See http://github.com/anguslees/openembedded-android/commit/82439ae0143a158bcf9953ab766d4a26c3a1a6ce for my patch to do this for glib, for example.

This is easy if you don't actually *need* the correct decimal point character.  If you are going to show this to a user, then you're out of luck - you probably need to go find the appropriate locale information in Java-land (and perhaps implement your own more correct lconv replacement functions if that makes the code changes easier).

 - Gus

Xavier Bigand

unread,
May 11, 2010, 11:33:51 AM5/11/10
to android-ndk
Thx,

It's not really important for me to have the right value, I am not
using lua strings for applications texts.

On 11 mai, 01:27, Angus Lees <al...@google.com> wrote:
> There are various other fields missing from Android versions of C structs
> too (pw_gecos, etc).
>
> If lua uses autoconf, it's quite easy to add AC_CHECK_MEMBERS checks for the
> missing struct members and #ifdef out the offending code.  Seehttp://github.com/anguslees/openembedded-android/commit/82439ae0143a1...
> my patch to do this for glib, for example.
>
> This is easy if you don't actually *need* the correct decimal point
> character.  If you are going to show this to a user, then you're out of luck
> - you probably need to go find the appropriate locale information in
> Java-land (and perhaps implement your own more correct lconv replacement
> functions if that makes the code changes easier).
>
>  - Gus
>
>
>
> On Tue, May 11, 2010 at 08:16, Dianne Hackborn <hack...@android.com> wrote:
> > Bionic doesn't really support c locale; you should use the Java APIs to get
> > this kind of information.
>
> > On Mon, May 10, 2010 at 2:39 PM, Xavier Bigand <flamaros.xav...@gmail.com>wrote:
>
> >> Hi,
>
> >> I am trying to compile lua with my engine but the member decimal_point
> >> isn't present in the lconv struct.
>
> >> For the moment I force the result as '.' character. Is their a way to
> >> get a fixed local.h?
>
> >> --
> >> You received this message because you are subscribed to the Google Groups
> >> "android-ndk" group.
> >> To post to this group, send email to andro...@googlegroups.com.
> >> To unsubscribe from this group, send email to
> >> android-ndk...@googlegroups.com<android-ndk%2Bunsu...@googlegroups.com>
> >> .
> >> For more options, visit this group at
> >>http://groups.google.com/group/android-ndk?hl=en.
>
> > --
> > Dianne Hackborn
> > Android framework engineer
> > hack...@android.com
>
> > Note: please don't send private questions to me, as I don't have time to
> > provide private support, and so won't reply to such e-mails.  All such
> > questions should be posted on public forums, where I and others can see and
> > answer them.
>
> >  --
> > You received this message because you are subscribed to the Google Groups
> > "android-ndk" group.
> > To post to this group, send email to andro...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > android-ndk...@googlegroups.com<android-ndk%2Bunsu...@googlegroups.com>
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/android-ndk?hl=en.
>
> --
> You received this message because you are subscribed to the Google Groups "android-ndk" group.
> To post to this group, send email to andro...@googlegroups.com.
> To unsubscribe from this group, send email to android-ndk...@googlegroups.com.
> For more options, visit this group athttp://groups.google.com/group/android-ndk?hl=en.

David Turner

unread,
May 11, 2010, 3:04:41 PM5/11/10
to andro...@googlegroups.com
We're not going to modify any structure that is part of the published stable headers, including the C ones.
This would break the ABI and make native code crash randomly otherwise (think stack corruption).
Reply all
Reply to author
Forward
0 new messages