diff --git a/src/rust/build.rs b/src/rust/build.rs index 4cecebef..f8b6d9a7 100644 --- a/src/rust/build.rs +++ b/src/rust/build.rs @@ -30,7 +30,6 @@ fn main() { "store_hdcc", "do_cb", "decode_vbi", - "realloc", "write_spumux_footer", "write_spumux_header", ]); diff --git a/src/rust/src/avc/core.rs b/src/rust/src/avc/core.rs index ed60866a..e4d68ab2 100644 --- a/src/rust/src/avc/core.rs +++ b/src/rust/src/avc/core.rs @@ -1,8 +1,9 @@ use crate::avc::common_types::*; use crate::avc::nal::*; use crate::avc::sei::*; -use crate::bindings::{cc_subtitle, encoder_ctx, lib_cc_decode, realloc}; +use crate::bindings::{cc_subtitle, encoder_ctx, lib_cc_decode}; use crate::ctorust::FromCType; +use crate::ffi_alloc::realloc; use crate::libccxr_exports::time::ccxr_set_fts; use crate::{anchor_hdcc, current_fps, process_hdcc, store_hdcc, MPEG_CLOCK_FREQ}; use lib_ccxr::common::AvcNalType; diff --git a/src/rust/src/ffi_alloc.rs b/src/rust/src/ffi_alloc.rs index 9a1a0b54..759795b0 100644 --- a/src/rust/src/ffi_alloc.rs +++ b/src/rust/src/ffi_alloc.rs @@ -2,6 +2,10 @@ use std::os::raw::c_void; extern "C" { fn free(ptr: *mut c_void); + // Declared here rather than through bindgen: bindgen types the size as + // `c_ulong`, which rustc >= 1.99 flags as a mismatched definition of a + // runtime symbol (`suspicious_runtime_symbol_definitions`). + pub fn realloc(ptr: *mut c_void, size: usize) -> *mut c_void; } /// Frees memory allocated by C code (malloc/calloc) ///