Skip to content

Commit

Permalink
just deprecate the cstr! macro without removing it
Browse files Browse the repository at this point in the history
Fixes #36
  • Loading branch information
lylythechosenone committed Dec 2, 2024
1 parent c223e3e commit 4dc6dcb
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/modules.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,18 @@ bitflags! {
}
}

/// Create a NUL-terminated C string from a string literal
#[macro_export]
#[deprecated(note = "use a C-string literal instead")]
macro_rules! cstr {
() => {
unsafe { core::ffi::CStr::from_bytes_with_nul_unchecked(b"\0") }
};
($s:expr) => {
unsafe { core::ffi::CStr::from_bytes_with_nul_unchecked(concat!($s, "\0").as_bytes()) }
};
}

/// An internal module that the kernel requests from the bootloader. Only
/// available with request revision 1 and greater.
#[repr(C)]
Expand Down

0 comments on commit 4dc6dcb

Please sign in to comment.