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.
This commit is contained in:
Abir Hassan
2026-04-19 01:16:46 +06:00
committed by GitHub
parent 10d9230836
commit c8932dabf7

View File

@@ -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