Statically compile that callback too

This commit is contained in:
Simon Gellis 2025-01-18 13:57:19 -05:00
parent 9f7895a457
commit e1a8006af7
2 changed files with 2 additions and 0 deletions

View File

@ -24,6 +24,7 @@ fn main() -> Result<(), Box<dyn Error>> {
.define("VB_SIGNED_PROPAGATE", None)
.define("VB_DIV_GENERIC", None)
.define("VB_DIRECT_EXECUTE", "on_execute")
.define("VB_DIRECT_FRAME", "on_frame")
.define("VB_DIRECT_READ", "on_read")
.define("VB_DIRECT_WRITE", "on_write")
.file(Path::new("shrooms-vb-core/core/vb.c"))

View File

@ -170,6 +170,7 @@ extern "C" {
fn vb_write(sim: *mut VB, address: u32, _type: VBDataType, value: i32) -> i32;
}
#[no_mangle]
extern "C" fn on_frame(sim: *mut VB) -> c_int {
// SAFETY: the *mut VB owns its userdata.
// There is no way for the userdata to be null or otherwise invalid.