haskell-foreign-rust/cbits/wrap-rust-haskell-ffi.c

10 lines
482 B
C
Raw Normal View History

2023-03-29 11:14:11 +00:00
// Forward-declare the Rust-exported function
void haskell_ffi_external_free(void* vec);
// Wrapper around the Rust function that takes an additional (unused) argument,
// which makes it match the Haskell `FinalizerEnvPtr` type. The wrapper also
// avoids linker errors when the Rust library is not available (of course,
// the Rust library must be linked into the final application).
void haskell_ffi_external_free_env(void* vec, void* ptr) {
haskell_ffi_external_free(vec);
}