Create a minimal locale implementation - #929
Merged
Merged
Conversation
keith-packard
force-pushed
the
tiny-locale
branch
2 times, most recently
from
January 28, 2025 17:59
317121b to
bcbaa0a
Compare
Using CMAKE_TOOLCHAIN_FILE elicits a cmake warning. Signed-off-by: Keith Packard <keithp@keithp.com>
These shouldn't be in RAM. Signed-off-by: Keith Packard <keithp@keithp.com>
keith-packard
force-pushed
the
tiny-locale
branch
2 times, most recently
from
January 28, 2025 21:12
3f3f709 to
d17e5fc
Compare
arichardson
reviewed
Jan 29, 2025
keith-packard
force-pushed
the
tiny-locale
branch
4 times, most recently
from
January 29, 2025 03:43
dd3ad06 to
f7e0fbf
Compare
Make sure we use the correct type for the variable field width arguments in calls to snprintf. Signed-off-by: Keith Packard <keithp@keithp.com>
keith-packard
force-pushed
the
tiny-locale
branch
from
January 29, 2025 05:35
f7e0fbf to
e76b321
Compare
The iconv code uses SHIFT-JIS, so match that. Signed-off-by: Keith Packard <keithp@keithp.com>
Replace explicit references to __locale_t internals with macros and inlines. Add libc/locale as an include directory so we can include setlocale.h without directly referencing the directory name Signed-off-by: Keith Packard <keithp@keithp.com>
This should provide most of the same functionality as the original locale code as available in embedded systems where there aren't any locale data files available. It is missing is the ability to construct an LC_ALL locale string which specifies multiple locale categories, but as the only useful category is LC_CTYPE, that doesn't seem terrible useful (and is not required by C). Signed-off-by: Keith Packard <keithp@keithp.com>
Make sure strftime does something reasonable Signed-off-by: Keith Packard <keithp@keithp.com>
These fail when time_t is only 4 byte (as on i386 native targets) Signed-off-by: Keith Packard <keithp@keithp.com>
keith-packard
force-pushed
the
tiny-locale
branch
from
January 29, 2025 06:13
e76b321 to
d0183e6
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This should provide most of the same functionality as the original locale code as available in embedded systems where there aren't any locale data files available. It is missing is the ability to construct an LC_ALL locale string which specifies multiple locale categories, but as the only useful category is LC_CTYPE, that doesn't seem terrible useful (and is not required by C).