From 656aa597fa9da48df6a842730a40bd39204b76ea Mon Sep 17 00:00:00 2001 From: Alaric Senat Date: Fri, 17 Jul 2026 23:34:13 +0200 Subject: [PATCH] build: bump bindgen to 0.72 and migrate to the allowlist API bindgen 0.59, relied on the now-deprecated whitelist_* builder methods and the bare CargoCallbacks unit struct. Move to 0.72 and its current API. --- libvlc-sys/Cargo.toml | 2 +- libvlc-sys/build.rs | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/libvlc-sys/Cargo.toml b/libvlc-sys/Cargo.toml index 83a8d16..51f88aa 100644 --- a/libvlc-sys/Cargo.toml +++ b/libvlc-sys/Cargo.toml @@ -22,7 +22,7 @@ crate-type = ["rlib"] libc = "0.2" [build-dependencies] -bindgen = {version = "0.59", optional = true } +bindgen = { version = "0.72", optional = true } pkg-config = "0.3" [target.'cfg(target_os = "windows")'.build-dependencies] diff --git a/libvlc-sys/build.rs b/libvlc-sys/build.rs index 45e307a..4bf213c 100644 --- a/libvlc-sys/build.rs +++ b/libvlc-sys/build.rs @@ -12,12 +12,12 @@ fn generate_bindings() { .use_core() // Use libc .ctypes_prefix("libc") - // Whitelist - .whitelist_type(".*vlc.*") - .whitelist_function(".*vlc.*") - .whitelist_var(".*vlc.*") - .whitelist_function("vsnprintf") - .parse_callbacks(Box::new(bindgen::CargoCallbacks)); + // Allowlist every (lib)vlc symbol. + .allowlist_item("(lib|LIB)?(vlc|VLC)_.*") + // Required by the Windows `legacy_stdio_definitions` link workaround + // (see `windows::link_vlc`). + .allowlist_function("vsnprintf") + .parse_callbacks(Box::new(bindgen::CargoCallbacks::new())); // Set header include paths let pkg_config_library = pkg_config::Config::new().probe("libvlc").unwrap();