initial
This commit is contained in:
20
src/branching.rs
Normal file
20
src/branching.rs
Normal file
@@ -0,0 +1,20 @@
|
||||
|
||||
#[macro_export]
|
||||
macro_rules! invoke_once {
|
||||
() => {
|
||||
unsafe {
|
||||
static mut __VALUE: bool = false;
|
||||
if __VALUE { false } else { __VALUE = true; true }
|
||||
}
|
||||
};
|
||||
|
||||
// if this is used inside of an unsafe codeblock
|
||||
// use this branch to avoid the unnecessary unsafe block warning
|
||||
(unsafe) => {
|
||||
{
|
||||
static mut __VALUE: bool = false;
|
||||
if __VALUE { false } else { __VALUE = true; true }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user