Skip to content

Commit

Permalink
Filter symbols which are available in bindings
Browse files Browse the repository at this point in the history
  • Loading branch information
hjmallon committed Nov 17, 2023
1 parent f707f10 commit 6d70cad
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
7 changes: 7 additions & 0 deletions xpc-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,13 @@ fn main() {
// bindings for.
.header(xpc_path)
.header(bootstrap_path)
// Filter the results to only relevant symbols
.allowlist_function("^xpc_.*")
.allowlist_var("^_xpc_.*")
.allowlist_var("^bootstrap_port")
// The following symbols should probably be in libc or mach2, but are not
.allowlist_function("^mach_port.*")
.allowlist_function("^vm_allocate")
// Tell cargo to invalidate the built crate whenever any of the
// included header files changed.
.parse_callbacks(Box::new(bindgen::CargoCallbacks::new()))
Expand Down
1 change: 1 addition & 0 deletions xpc-sys/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ extern crate lazy_static;
#[macro_use]
extern crate bitflags;

pub use libc::MAP_SHARED;
use libc::{geteuid, mach_task_self_, strerror, sysctlbyname, KERN_SUCCESS, MACH_PORT_NULL};
use std::ffi::{CStr, CString};
use std::os::raw::{c_char, c_int, c_long, c_void};
Expand Down

0 comments on commit 6d70cad

Please sign in to comment.