Skip to content

Commit c051331

Browse files
committed
Add static_borrow_mut!() macro
1 parent 0ea3fde commit c051331

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

examples/xbd-net/src/lib.rs

+3
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ fn panic(info: &core::panic::PanicInfo) -> ! { mcu_if::panic(info) }
1010
#[alloc_error_handler]
1111
fn alloc_error(layout: mcu_if::alloc::alloc::Layout) -> ! { mcu_if::alloc_error(layout) }
1212

13+
#[macro_export]
14+
macro_rules! static_borrow_mut { ($x:expr) => (unsafe { &mut *core::ptr::addr_of_mut!($x) }) }
15+
1316
use mcu_if::{println, alloc::boxed::Box};
1417

1518
mod xbd;

0 commit comments

Comments
 (0)