Attribute Macro skyline_macro::null_check
source · [−]#[null_check]
Expand description
Add a null check to dynamically linked functions. Applied at the extern block level.
Example:
#[null_check]
extern "C" {
fn not_an_available_import() -> u64;
}
Then, if not_an_available_import
is not available it will panic with the following message:
thread '<unnamed>' panicked at 'not_an_available_import is null (likely unlinked)', src/lib.rs:5:1
Note
Due to a bug, this may not consistently panic on release builds, use --debug
for install/run
commands to ensure this does not happen when testing.