Skip to content

Commit

Permalink
build: strict bindgen on static functions
Browse files Browse the repository at this point in the history
  • Loading branch information
Taowyoo committed Jun 27, 2023
1 parent 1c19fa0 commit df3a44c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion mbedtls-sys/build/bindgen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,12 +100,14 @@ impl super::BuildConfig {
};
}


// generate static function wrappers without any other rust related parameters to ensure
// correctness of result C code
bindgen::builder()
.clang_args(cc.get_compiler().args().iter().map(|arg| arg.to_str().unwrap()))
.header_contents("bindgen-input.h", &header)
.allowlist_function("^(?i)mbedtls_.*")
.allowlist_function("^(?i)psa_.*")
.wrap_static_fns(true)
.wrap_static_fns_path(&self.static_wrappers_c)
.generate().expect("bindgen error");
Expand Down

0 comments on commit df3a44c

Please sign in to comment.