Implement preinit related features in Rust

This commit is contained in:
topjohnwu
2024-03-28 14:11:03 -07:00
parent 1eddbfd72c
commit a1b6568226
13 changed files with 312 additions and 164 deletions
+1
View File
@@ -22,3 +22,4 @@ argh = { workspace = true }
bytemuck = { workspace = true }
num-traits = { workspace = true }
num-derive = { workspace = true }
const_format = { workspace = true }
+3 -1
View File
@@ -451,6 +451,7 @@ pub struct FsPathBuf<'a>(&'a mut dyn Utf8CStrWrite);
impl<'a> FsPathBuf<'a> {
pub fn new(value: &'a mut dyn Utf8CStrWrite) -> Self {
value.clear();
FsPathBuf(value)
}
@@ -656,7 +657,8 @@ macro_rules! cstr {
);
#[allow(unused_unsafe)]
unsafe {
$crate::Utf8CStr::from_bytes_unchecked(concat!($($str)*, "\0").as_bytes())
$crate::Utf8CStr::from_bytes_unchecked($crate::const_format::concatcp!($($str)*, "\0")
.as_bytes())
}
}};
}
+1
View File
@@ -3,6 +3,7 @@
#![feature(io_error_more)]
#![feature(utf8_chunks)]
pub use const_format;
pub use libc;
use num_traits::FromPrimitive;