Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perl_langinfo.h: Fix to work on Android #22650

Merged
merged 2 commits into from
Oct 21, 2024
Merged

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
33 checks passed
@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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants