From cd6d404a1bbb6935b99eece2df1f9af7cb26cb45 Mon Sep 17 00:00:00 2001 From: Alaric Senat Date: Tue, 25 Aug 2026 11:14:48 +0200 Subject: [PATCH] libvlc-sys: re-generate the bindings The previous bindings were built on an arbitrary host (my machine) rather than the stable MSRV container we use for the CI. --- libvlc-sys/bindings.rs | 206 ++--------------------------------------- 1 file changed, 6 insertions(+), 200 deletions(-) diff --git a/libvlc-sys/bindings.rs b/libvlc-sys/bindings.rs index baef517..baf1397 100644 --- a/libvlc-sys/bindings.rs +++ b/libvlc-sys/bindings.rs @@ -1,145 +1,5 @@ /* automatically generated by rust-bindgen 0.72.1 */ -#[repr(C)] -#[derive(Copy, Clone, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)] -pub struct __BindgenBitfieldUnit { - storage: Storage, -} -impl __BindgenBitfieldUnit { - #[inline] - pub const fn new(storage: Storage) -> Self { - Self { storage } - } -} -impl __BindgenBitfieldUnit -where - Storage: AsRef<[u8]> + AsMut<[u8]>, -{ - #[inline] - fn extract_bit(byte: u8, index: usize) -> bool { - let bit_index = if cfg!(target_endian = "big") { - 7 - (index % 8) - } else { - index % 8 - }; - let mask = 1 << bit_index; - byte & mask == mask - } - #[inline] - pub fn get_bit(&self, index: usize) -> bool { - debug_assert!(index / 8 < self.storage.as_ref().len()); - let byte_index = index / 8; - let byte = self.storage.as_ref()[byte_index]; - Self::extract_bit(byte, index) - } - #[inline] - pub unsafe fn raw_get_bit(this: *const Self, index: usize) -> bool { - debug_assert!(index / 8 < core::mem::size_of::()); - let byte_index = index / 8; - let byte = unsafe { - *(core::ptr::addr_of!((*this).storage) as *const u8).offset(byte_index as isize) - }; - Self::extract_bit(byte, index) - } - #[inline] - fn change_bit(byte: u8, index: usize, val: bool) -> u8 { - let bit_index = if cfg!(target_endian = "big") { - 7 - (index % 8) - } else { - index % 8 - }; - let mask = 1 << bit_index; - if val { - byte | mask - } else { - byte & !mask - } - } - #[inline] - pub fn set_bit(&mut self, index: usize, val: bool) { - debug_assert!(index / 8 < self.storage.as_ref().len()); - let byte_index = index / 8; - let byte = &mut self.storage.as_mut()[byte_index]; - *byte = Self::change_bit(*byte, index, val); - } - #[inline] - pub unsafe fn raw_set_bit(this: *mut Self, index: usize, val: bool) { - debug_assert!(index / 8 < core::mem::size_of::()); - let byte_index = index / 8; - let byte = unsafe { - (core::ptr::addr_of_mut!((*this).storage) as *mut u8).offset(byte_index as isize) - }; - unsafe { *byte = Self::change_bit(*byte, index, val) }; - } - #[inline] - pub fn get(&self, bit_offset: usize, bit_width: u8) -> u64 { - debug_assert!(bit_width <= 64); - debug_assert!(bit_offset / 8 < self.storage.as_ref().len()); - debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len()); - let mut val = 0; - for i in 0..(bit_width as usize) { - if self.get_bit(i + bit_offset) { - let index = if cfg!(target_endian = "big") { - bit_width as usize - 1 - i - } else { - i - }; - val |= 1 << index; - } - } - val - } - #[inline] - pub unsafe fn raw_get(this: *const Self, bit_offset: usize, bit_width: u8) -> u64 { - debug_assert!(bit_width <= 64); - debug_assert!(bit_offset / 8 < core::mem::size_of::()); - debug_assert!((bit_offset + (bit_width as usize)) / 8 <= core::mem::size_of::()); - let mut val = 0; - for i in 0..(bit_width as usize) { - if unsafe { Self::raw_get_bit(this, i + bit_offset) } { - let index = if cfg!(target_endian = "big") { - bit_width as usize - 1 - i - } else { - i - }; - val |= 1 << index; - } - } - val - } - #[inline] - pub fn set(&mut self, bit_offset: usize, bit_width: u8, val: u64) { - debug_assert!(bit_width <= 64); - debug_assert!(bit_offset / 8 < self.storage.as_ref().len()); - debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len()); - for i in 0..(bit_width as usize) { - let mask = 1 << i; - let val_bit_is_set = val & mask == mask; - let index = if cfg!(target_endian = "big") { - bit_width as usize - 1 - i - } else { - i - }; - self.set_bit(index + bit_offset, val_bit_is_set); - } - } - #[inline] - pub unsafe fn raw_set(this: *mut Self, bit_offset: usize, bit_width: u8, val: u64) { - debug_assert!(bit_width <= 64); - debug_assert!(bit_offset / 8 < core::mem::size_of::()); - debug_assert!((bit_offset + (bit_width as usize)) / 8 <= core::mem::size_of::()); - for i in 0..(bit_width as usize) { - let mask = 1 << i; - let val_bit_is_set = val & mask == mask; - let index = if cfg!(target_endian = "big") { - bit_width as usize - 1 - i - } else { - i - }; - unsafe { Self::raw_set_bit(this, index + bit_offset, val_bit_is_set) }; - } - } -} pub const VLC_VLC_H: u32 = 1; pub const VLC_LIBVLC_H: u32 = 1; pub const VLC_LIBVLC_RENDERER_DISCOVERER_H: u32 = 1; @@ -156,7 +16,6 @@ pub const LIBVLC_DIALOG_H: u32 = 1; pub const LIBVLC_VLM_H: u32 = 1; pub const LIBVLC_DEPRECATED_H: u32 = 1; pub type __gnuc_va_list = __builtin_va_list; -pub type __uint64_t = libc::c_ulong; pub type __off_t = libc::c_long; pub type __off64_t = libc::c_long; pub type FILE = _IO_FILE; @@ -194,9 +53,7 @@ pub struct _IO_FILE { pub _markers: *mut _IO_marker, pub _chain: *mut _IO_FILE, pub _fileno: libc::c_int, - pub _bitfield_align_1: [u32; 0], - pub _bitfield_1: __BindgenBitfieldUnit<[u8; 3usize]>, - pub _short_backupbuf: [libc::c_char; 1usize], + pub _flags2: libc::c_int, pub _old_offset: __off_t, pub _cur_column: libc::c_ushort, pub _vtable_offset: libc::c_schar, @@ -207,11 +64,9 @@ pub struct _IO_FILE { pub _wide_data: *mut _IO_wide_data, pub _freeres_list: *mut _IO_FILE, pub _freeres_buf: *mut libc::c_void, - pub _prevchain: *mut *mut _IO_FILE, + pub __pad5: usize, pub _mode: libc::c_int, - pub _unused3: libc::c_int, - pub _total_written: __uint64_t, - pub _unused2: [libc::c_char; 8usize], + pub _unused2: [libc::c_char; 20usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { @@ -243,8 +98,7 @@ const _: () = { ["Offset of field: _IO_FILE::_markers"][::core::mem::offset_of!(_IO_FILE, _markers) - 96usize]; ["Offset of field: _IO_FILE::_chain"][::core::mem::offset_of!(_IO_FILE, _chain) - 104usize]; ["Offset of field: _IO_FILE::_fileno"][::core::mem::offset_of!(_IO_FILE, _fileno) - 112usize]; - ["Offset of field: _IO_FILE::_short_backupbuf"] - [::core::mem::offset_of!(_IO_FILE, _short_backupbuf) - 119usize]; + ["Offset of field: _IO_FILE::_flags2"][::core::mem::offset_of!(_IO_FILE, _flags2) - 116usize]; ["Offset of field: _IO_FILE::_old_offset"] [::core::mem::offset_of!(_IO_FILE, _old_offset) - 120usize]; ["Offset of field: _IO_FILE::_cur_column"] @@ -262,58 +116,10 @@ const _: () = { [::core::mem::offset_of!(_IO_FILE, _freeres_list) - 168usize]; ["Offset of field: _IO_FILE::_freeres_buf"] [::core::mem::offset_of!(_IO_FILE, _freeres_buf) - 176usize]; - ["Offset of field: _IO_FILE::_prevchain"] - [::core::mem::offset_of!(_IO_FILE, _prevchain) - 184usize]; + ["Offset of field: _IO_FILE::__pad5"][::core::mem::offset_of!(_IO_FILE, __pad5) - 184usize]; ["Offset of field: _IO_FILE::_mode"][::core::mem::offset_of!(_IO_FILE, _mode) - 192usize]; - ["Offset of field: _IO_FILE::_unused3"][::core::mem::offset_of!(_IO_FILE, _unused3) - 196usize]; - ["Offset of field: _IO_FILE::_total_written"] - [::core::mem::offset_of!(_IO_FILE, _total_written) - 200usize]; - ["Offset of field: _IO_FILE::_unused2"][::core::mem::offset_of!(_IO_FILE, _unused2) - 208usize]; + ["Offset of field: _IO_FILE::_unused2"][::core::mem::offset_of!(_IO_FILE, _unused2) - 196usize]; }; -impl _IO_FILE { - #[inline] - pub fn _flags2(&self) -> libc::c_int { - unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 24u8) as u32) } - } - #[inline] - pub fn set__flags2(&mut self, val: libc::c_int) { - unsafe { - let val: u32 = ::core::mem::transmute(val); - self._bitfield_1.set(0usize, 24u8, val as u64) - } - } - #[inline] - pub unsafe fn _flags2_raw(this: *const Self) -> libc::c_int { - unsafe { - ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 3usize]>>::raw_get( - ::core::ptr::addr_of!((*this)._bitfield_1), - 0usize, - 24u8, - ) as u32) - } - } - #[inline] - pub unsafe fn set__flags2_raw(this: *mut Self, val: libc::c_int) { - unsafe { - let val: u32 = ::core::mem::transmute(val); - <__BindgenBitfieldUnit<[u8; 3usize]>>::raw_set( - ::core::ptr::addr_of_mut!((*this)._bitfield_1), - 0usize, - 24u8, - val as u64, - ) - } - } - #[inline] - pub fn new_bitfield_1(_flags2: libc::c_int) -> __BindgenBitfieldUnit<[u8; 3usize]> { - let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 3usize]> = Default::default(); - __bindgen_bitfield_unit.set(0usize, 24u8, { - let _flags2: u32 = unsafe { ::core::mem::transmute(_flags2) }; - _flags2 as u64 - }); - __bindgen_bitfield_unit - } -} pub type va_list = __gnuc_va_list; unsafe extern "C" { pub fn vsnprintf(