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

openbsd: add more locale constants for use with newlocale() #2965

Merged
merged 2 commits into from Oct 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 8 additions & 0 deletions libc-test/semver/openbsd.txt
Expand Up @@ -446,12 +446,20 @@ KI_MAXLOGNAME
KI_NGROUPS
KI_WMESGLEN
LC_ALL
LC_ALL_MASK
LC_COLLATE
LC_COLLATE_MASK
LC_CTYPE
LC_CTYPE_MASK
LC_GLOBAL_LOCALE
LC_MESSAGES
LC_MESSAGES_MASK
LC_MONETARY
LC_MONETARY_MASK
LC_NUMERIC
LC_NUMERIC_MASK
LC_TIME
LC_TIME_MASK
LOG_AUTHPRIV
LOG_CRON
LOG_FTP
Expand Down
12 changes: 12 additions & 0 deletions src/unix/bsd/netbsdlike/openbsd/mod.rs
Expand Up @@ -1643,6 +1643,18 @@ pub const MNT_WAIT: ::c_int = 1;
pub const MNT_NOWAIT: ::c_int = 2;
pub const MNT_LAZY: ::c_int = 3;

pub const LC_COLLATE_MASK: ::c_int = 1 << ::LC_COLLATE;
pub const LC_CTYPE_MASK: ::c_int = 1 << ::LC_CTYPE;
pub const LC_MONETARY_MASK: ::c_int = 1 << ::LC_MONETARY;
pub const LC_NUMERIC_MASK: ::c_int = 1 << ::LC_NUMERIC;
pub const LC_TIME_MASK: ::c_int = 1 << ::LC_TIME;
pub const LC_MESSAGES_MASK: ::c_int = 1 << ::LC_MESSAGES;

const _LC_LAST: ::c_int = 7;
pub const LC_ALL_MASK: ::c_int = (1 << _LC_LAST) - 2;

pub const LC_GLOBAL_LOCALE: ::locale_t = -1isize as ::locale_t;

const_fn! {
{const} fn _ALIGN(p: usize) -> usize {
(p + _ALIGNBYTES) & !_ALIGNBYTES
Expand Down