luaur-vm 0.1.3

The Luau register virtual machine and standard library (Rust).
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use crate::macros::cast_to::cast_to;

#[allow(non_snake_case)]
#[macro_export]
macro_rules! pcRel {
    ($pc:expr, $p:expr) => {
        if !$pc.is_null() && $pc != (*$p).code {
            $crate::macros::cast_to::cast_to!(
                core::ffi::c_int,
                ($pc as usize).wrapping_sub((*$p).code as usize) / core::mem::size_of::<u32>()
            ) - 1
        } else {
            0
        }
    };
}

pub use pcRel;