From 75224dd1cf6aa419b3e24ced42c77284a715e6a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Marie?= Date: Mon, 17 Oct 2022 16:06:41 +0000 Subject: [PATCH 1/2] openbsd: add more locale constants for use with newlocale() --- src/unix/bsd/netbsdlike/openbsd/mod.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/unix/bsd/netbsdlike/openbsd/mod.rs b/src/unix/bsd/netbsdlike/openbsd/mod.rs index 506306e9f7928..f63ad9e638600 100644 --- a/src/unix/bsd/netbsdlike/openbsd/mod.rs +++ b/src/unix/bsd/netbsdlike/openbsd/mod.rs @@ -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 From 21f11f35070e8034b516f3fe1f2b4e29200f6241 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Marie?= Date: Tue, 18 Oct 2022 04:45:05 +0000 Subject: [PATCH 2/2] add new constants to openbsd.txt --- libc-test/semver/openbsd.txt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/libc-test/semver/openbsd.txt b/libc-test/semver/openbsd.txt index cf9d73c58638f..bdfd1b7744eae 100644 --- a/libc-test/semver/openbsd.txt +++ b/libc-test/semver/openbsd.txt @@ -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