libvlc-sys: drop the generated layout assertions

We are trying to get the bindings build with a single committed
source file compiled on every target. Assertions are per-host and would
break on different architecture than the commiter's one. Layout checks
notably break the 32bit targets.
master
Alaric Senat 2026-08-20 17:11:11 +02:00
parent 9713c5ac7e
commit 19bed7f818
2 changed files with 7 additions and 742 deletions

File diff suppressed because it is too large Load Diff

View File

@ -43,16 +43,20 @@ fn generate_bindings() {
.ctypes_prefix("libc")
// Allowlist every (lib)vlc symbol.
.allowlist_item("(lib|LIB)?(vlc|VLC)_.*")
// libvlc only uses FILE behind a pointer. Map it
// to libc's opaque, per-platform FILE rather than emitting glibc's
// plain _IO_FILE, whose baked-in layout breaks non-Linux builds.
// Avoid leaking unecessary glibc/platform specifics.
.blocklist_type("_IO_.*")
.blocklist_type("_iobuf")
.blocklist_type("FILE")
.blocklist_type("__off.*")
.blocklist_type("__uint64_t")
.raw_line("pub use libc::FILE;")
// Block the whole va_list family and rewrite the parameters bindings to our own `VaList`,
// which is ABI-correct on every target.
.blocklist_type(".*va_list.*")
.raw_line("pub use crate::valist::VaList;")
// These bindings are committed once and compiled everywhere, so the layout assertions would
// only ever encode the machine that ran bindgen.
.layout_tests(false)
// Emit a single extern block rather than one per function.
.merge_extern_blocks(true);