Skip to content

Conversation

khwilliamson
Copy link
Contributor

@khwilliamson khwilliamson commented Oct 9, 2024

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.


  • This set of changes does not require a perldelta entry.
@jkeenan
Copy link
Contributor

jkeenan commented Oct 9, 2024

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.

@khwilliamson khwilliamson changed the title perl_langinfo.h: Resume some assumptions perl_langinfo.h: Remove some assumptions Oct 10, 2024
See GH Perl#22627.

Glibc 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.
@khwilliamson khwilliamson changed the title perl_langinfo.h: Remove some assumptions perl_langinfo.h: Fix to work on Android Oct 11, 2024
@khwilliamson khwilliamson merged commit 5957de4 into Perl:blead Oct 21, 2024
@khwilliamson khwilliamson deleted the android branch October 21, 2024 21:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants