summaryrefslogtreecommitdiff
path: root/libbindgen/src
diff options
context:
space:
mode:
Diffstat (limited to 'libbindgen/src')
-rw-r--r--libbindgen/src/lib.rs10
1 files changed, 7 insertions, 3 deletions
diff --git a/libbindgen/src/lib.rs b/libbindgen/src/lib.rs
index 3ced6dab..1acfd143 100644
--- a/libbindgen/src/lib.rs
+++ b/libbindgen/src/lib.rs
@@ -168,8 +168,8 @@ impl Builder {
/// Set the input C/C++ header.
pub fn header<T: Into<String>>(mut self, header: T) -> Builder {
let header = header.into();
- self.options.input_header = Some(header.clone());
- self.clang_arg(header)
+ self.options.input_header = Some(header);
+ self
}
/// Generate a C/C++ file that includes the header and has dummy uses of
@@ -504,11 +504,15 @@ impl<'ctx> Bindings<'ctx> {
///
/// Deprecated - use a `Builder` instead
#[deprecated]
- pub fn generate(options: BindgenOptions,
+ pub fn generate(mut options: BindgenOptions,
span: Option<Span>)
-> Result<Bindings<'ctx>, ()> {
let span = span.unwrap_or(DUMMY_SP);
+ if let Some(h) = options.input_header.as_ref() {
+ options.clang_args.push(h.clone())
+ }
+
let mut context = BindgenContext::new(options);
try!(parse(&mut context));