removed unnecessary strings
This commit is contained in:
parent
112e052f18
commit
72c46447c1
11
build.rs
11
build.rs
@ -28,19 +28,16 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
use std::{
|
use std::{
|
||||||
io::{ self, Write },
|
io::{ Error, Write },
|
||||||
process::{ Command, exit, Stdio },
|
process::{ Command, exit, Stdio },
|
||||||
path::PathBuf,
|
path::PathBuf,
|
||||||
};
|
};
|
||||||
|
|
||||||
use bindgen::{ Builder, CargoCallbacks, MacroTypeVariation };
|
use bindgen::{ Builder, CargoCallbacks, MacroTypeVariation };
|
||||||
|
|
||||||
fn main() -> Result<(), io::Error> {
|
fn main() -> Result<(), Error> {
|
||||||
let mut header = String::new();
|
let mut header = String::new();
|
||||||
|
|
||||||
/* bindgen has a dependency on clang for now */
|
|
||||||
Command::new("clang").spawn().expect("Missing dependency: clang");
|
|
||||||
|
|
||||||
/* Locate sysexits.h using cpp(1) */
|
/* Locate sysexits.h using cpp(1) */
|
||||||
let mut process = Command::new("cpp")
|
let mut process = Command::new("cpp")
|
||||||
.arg("-M")
|
.arg("-M")
|
||||||
@ -54,8 +51,8 @@ fn main() -> Result<(), io::Error> {
|
|||||||
|
|
||||||
let output = process.wait_with_output()?.stdout;
|
let output = process.wait_with_output()?.stdout;
|
||||||
|
|
||||||
let headers = String::from_utf8(output).unwrap_or_else( |_| {
|
let headers = String::from_utf8(output).unwrap_or_else( |e| {
|
||||||
eprintln!("Output from cpp(1) is invalid UTF-8.");
|
Error::other(e.to_string());
|
||||||
/* Exit with status 1 because we’re bootstrapping sysexits.h, silly! */
|
/* Exit with status 1 because we’re bootstrapping sysexits.h, silly! */
|
||||||
exit(1);
|
exit(1);
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user