mirror of
https://github.com/jkcoxson/idevice.git
synced 2026-03-02 14:36:16 +01:00
Append plist.h to idevice header
This commit is contained in:
10
ffi/build.rs
10
ffi/build.rs
@@ -1,6 +1,6 @@
|
|||||||
// Jackson Coxson
|
// Jackson Coxson
|
||||||
|
|
||||||
use std::env;
|
use std::{env, fs::OpenOptions, io::Write};
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
let crate_dir = env::var("CARGO_MANIFEST_DIR").unwrap();
|
let crate_dir = env::var("CARGO_MANIFEST_DIR").unwrap();
|
||||||
@@ -12,7 +12,6 @@ fn main() {
|
|||||||
)
|
)
|
||||||
.with_language(cbindgen::Language::C)
|
.with_language(cbindgen::Language::C)
|
||||||
.with_sys_include("sys/socket.h")
|
.with_sys_include("sys/socket.h")
|
||||||
.with_include("plist.h")
|
|
||||||
.generate()
|
.generate()
|
||||||
.expect("Unable to generate bindings")
|
.expect("Unable to generate bindings")
|
||||||
.write_to_file("idevice.h");
|
.write_to_file("idevice.h");
|
||||||
@@ -25,7 +24,8 @@ fn main() {
|
|||||||
.into_body()
|
.into_body()
|
||||||
.read_to_string()
|
.read_to_string()
|
||||||
.expect("failed to get string content");
|
.expect("failed to get string content");
|
||||||
std::fs::write("plist.h", h).expect("failed to save to string");
|
let mut f = OpenOptions::new().append(true).open("idevice.h").unwrap();
|
||||||
|
f.write_all(b"\n\n\n").unwrap();
|
||||||
println!("cargo:rustc-link-arg=-lplist-2.0");
|
f.write_all(&h.into_bytes())
|
||||||
|
.expect("failed to append plist.h");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -73,6 +73,10 @@ pub struct ReadWriteOpaque {
|
|||||||
pub struct IdeviceHandle(pub Idevice);
|
pub struct IdeviceHandle(pub Idevice);
|
||||||
pub struct IdeviceSocketHandle(IdeviceSocket);
|
pub struct IdeviceSocketHandle(IdeviceSocket);
|
||||||
|
|
||||||
|
/// Stub to avoid header problems
|
||||||
|
#[allow(non_camel_case_types)]
|
||||||
|
pub type plist_t = *mut std::ffi::c_void;
|
||||||
|
|
||||||
// https://github.com/mozilla/cbindgen/issues/539
|
// https://github.com/mozilla/cbindgen/issues/539
|
||||||
#[allow(non_camel_case_types, unused)]
|
#[allow(non_camel_case_types, unused)]
|
||||||
struct sockaddr;
|
struct sockaddr;
|
||||||
|
|||||||
Reference in New Issue
Block a user