Skip to content

Commit

Permalink
Merge pull request #976 from Cobrand/master
Browse files Browse the repository at this point in the history
Fix compilation with use-bindgen
  • Loading branch information
Cobrand authored Mar 16, 2020
2 parents 4e81db5 + b017349 commit a311b88
Show file tree
Hide file tree
Showing 5 changed files with 5,863 additions and 5,268 deletions.
2 changes: 1 addition & 1 deletion sdl2-sys/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ path = "src/lib.rs"
libc = "^0.2"

[build-dependencies.bindgen]
version = "^0.42"
version = "^0.53"
optional = true

[build-dependencies.pkg-config]
Expand Down
4 changes: 1 addition & 3 deletions sdl2-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -543,6 +543,7 @@ fn generate_bindings(target: &str, host: &str, headers_paths: &[String]) {
let mut bindings = bindgen::Builder::default()
// enable no_std-friendly output by only using core definitions
.use_core()
.default_enum_style(bindgen::EnumVariation::Rust { non_exhaustive: false })
.ctypes_prefix("libc");

let mut image_bindings = bindgen::Builder::default()
Expand Down Expand Up @@ -704,13 +705,11 @@ fn generate_bindings(target: &str, host: &str, headers_paths: &[String]) {

let bindings = bindings
.header("wrapper.h")
.rustified_enum(".*")
.blacklist_type("FP_NAN")
.blacklist_type("FP_INFINITE")
.blacklist_type("FP_ZERO")
.blacklist_type("FP_SUBNORMAL")
.blacklist_type("FP_NORMAL")
.blacklist_type("max_align_t") // Until https://github.com/rust-lang-nursery/rust-bindgen/issues/550 gets fixed
.derive_debug(false)
.generate()
.expect("Unable to generate bindings!");
Expand All @@ -729,7 +728,6 @@ fn generate_bindings(target: &str, host: &str, headers_paths: &[String]) {
.blacklist_type("FP_ZERO")
.blacklist_type("FP_SUBNORMAL")
.blacklist_type("FP_NORMAL")
.blacklist_type("max_align_t") // Until https://github.com/rust-lang-nursery/rust-bindgen/issues/550 gets fixed
.whitelist_type("IMG.*")
.whitelist_function("IMG.*")
.whitelist_var("IMG.*")
Expand Down
Loading

0 comments on commit a311b88

Please sign in to comment.