This commit is contained in:
2023-09-04 06:26:35 -04:00
commit a5fe71ebb3
26 changed files with 1186 additions and 0 deletions

20
src/branching.rs Normal file
View 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 }
}
}
}