Refresh libctru to the latest version
@ -29,8 +29,7 @@ impl LinearAllocator {
unsafe impl Allocator for LinearAllocator {
fn allocate(&self, layout: Layout) -> Result<NonNull<[u8]>, AllocError> {
let pointer =
let pointer = unsafe { ctru_sys::linearMemAlign(layout.size(), layout.align()) };
unsafe { ctru_sys::linearMemAlign(layout.size() as u32, layout.align() as u32) };
NonNull::new(pointer.cast())
.map(|ptr| NonNull::slice_from_raw_parts(ptr, layout.size()))
@ -45,9 +45,7 @@ pub fn device_id() -> crate::Result<u32> {
}
pub fn generate_random_bytes(out: &mut [u8]) -> crate::Result<()> {
ResultCode(unsafe {
ResultCode(unsafe { ctru_sys::PS_GenerateRandomBytes(out as *mut _ as *mut _, out.len()) })?;
ctru_sys::PS_GenerateRandomBytes(out as *mut _ as *mut _, out.len() as u32)
})?;
Ok(())
@ -11,9 +11,9 @@ bindgen "$DEVKITPRO/libctru/include/3ds.h" \
--ctypes-prefix "::libc" \
--no-prepend-enum-name \
--generate "functions,types,vars" \
--blacklist-type "u(8|16|32|64)" \
--blocklist-type "u(8|16|32|64)" \
--blacklist-type "__builtin_va_list" \
--blocklist-type "__builtin_va_list" \
--blacklist-type "__va_list" \
--blocklist-type "__va_list" \
--opaque-type "MiiData" \
--with-derive-default \
-- \