From c8932dabf7964658cdcf8e546c746fc7d6e0f699 Mon Sep 17 00:00:00 2001 From: Abir Hassan <67853959+XAbirHasan@users.noreply.github.com> Date: Sun, 19 Apr 2026 01:16:46 +0600 Subject: [PATCH] fix: use c_char instead of i8 for CapInfo.lang to fix ARM compilation (#2267) When building with Docker on an Apple Silicon Mac (M4), the Rust build fails with type mismatch errors in common.rs and ctorust.rs. The lang field in CapInfo is hardcoded as [i8; 4], which only matches the bindgen-generated c_char on x86 (where c_char = i8). On ARM platforms like Apple Silicon, c_char = u8, so the types don't match and compilation fails with: error[E0308]: mismatched types - expected `[u8; 4]`, found `[i8; 4]`... Change to [c_char; 4] which resolves to the correct type on both architectures. --- src/rust/src/demuxer/common_types.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/rust/src/demuxer/common_types.rs b/src/rust/src/demuxer/common_types.rs index b83bf17e..1d4ec59f 100644 --- a/src/rust/src/demuxer/common_types.rs +++ b/src/rust/src/demuxer/common_types.rs @@ -2,6 +2,7 @@ use crate::bindings::{lib_ccx_ctx, list_head}; use crate::ffi_alloc; use lib_ccxr::common::{Codec, Decoder608Report, DecoderDtvccReport, StreamMode, StreamType}; use lib_ccxr::time::Timestamp; +use std::ffi::c_char; use std::ptr::null_mut; // Size of the Startbytes Array in CcxDemuxer - const 1MB @@ -79,7 +80,7 @@ pub struct CapInfo { pub prev_counter: i32, pub codec_private_data: *mut std::ffi::c_void, pub ignore: i32, - pub lang: [i8; 4], + pub lang: [c_char; 4], /** * List joining all streams in TS