From 85fe183c1652da1026c2c79a0524a6a887d46ee7 Mon Sep 17 00:00:00 2001 From: XAbirHasan Date: Tue, 14 Apr 2026 16:24:36 +0600 Subject: [PATCH] fix: use c_char instead of i8 for CapInfo.lang to fix ARM compilation 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 b83bf17e2..1d4ec59f2 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