Perl / perl5

🐪 The Perl programming language
https://dev.perl.org/perl5/
Other
1.95k stars 554 forks source link

perl_langinfo.h: Fix to work on Android #22650

Closed khwilliamson closed 13 hours ago

khwilliamson commented 1 week ago

See GH #22627.

libc has a few locale categories that aren't used elsewhere, AFAIK. Android has a crippled implementation of them, in that it has none of the items that comprise the categories.

In a typical langinfo.h, these are enum fields, so their existence can't be checked with an #ifdef, but in Android, everything is a #define, so much be checked with #ifdef. To get around this without writing a Configure probe, this commit just creates defines when they are missing the category (which catches the non-Androids) or when using Android.


jkeenan commented 1 week ago

This p.r. is failing one test in the initial "sanity check" CI run: ../ext/I18N-Langinfo/t/Langinfo.t

# Failed test 92 - Returns expected value('ISO') for _NL_IDENTIFICATION_TERRITORY at t/locale.t line 237
#      got ""
# expected "ISO"
../ext/XS-APItest/t/locale.t ......................................... 
Failed 1/106 subtests 
    (less 5 skipped subtests: 100 okay)

Reproduced on a local build of this p.r. Also, as I noted in a different pull request, at the end of 'make test_prep' I'm getting a log of build-time warnings.