File tree 3 files changed +25
-3
lines changed 3 files changed +25
-3
lines changed Original file line number Diff line number Diff line change @@ -168,8 +168,8 @@ impl Builder {
168
168
/// Set the input C/C++ header.
169
169
pub fn header < T : Into < String > > ( mut self , header : T ) -> Builder {
170
170
let header = header. into ( ) ;
171
- self . options . input_header = Some ( header. clone ( ) ) ;
172
- self . clang_arg ( header )
171
+ self . options . input_header = Some ( header) ;
172
+ self
173
173
}
174
174
175
175
/// Generate a C/C++ file that includes the header and has dummy uses of
@@ -504,11 +504,15 @@ impl<'ctx> Bindings<'ctx> {
504
504
///
505
505
/// Deprecated - use a `Builder` instead
506
506
#[ deprecated]
507
- pub fn generate ( options : BindgenOptions ,
507
+ pub fn generate ( mut options : BindgenOptions ,
508
508
span : Option < Span > )
509
509
-> Result < Bindings < ' ctx > , ( ) > {
510
510
let span = span. unwrap_or ( DUMMY_SP ) ;
511
511
512
+ if let Some ( h) = options. input_header . as_ref ( ) {
513
+ options. clang_args . push ( h. clone ( ) )
514
+ }
515
+
512
516
let mut context = BindgenContext :: new ( options) ;
513
517
try!( parse ( & mut context) ) ;
514
518
Original file line number Diff line number Diff line change
1
+ /* automatically generated by rust-bindgen */
2
+
3
+
4
+ #![ allow( non_snake_case) ]
5
+
6
+
7
+ #[ repr( C ) ]
8
+ #[ derive( Debug , Copy , Clone ) ]
9
+ pub struct Foo < T > {
10
+ pub bar : :: std:: os:: raw:: c_int ,
11
+ pub _phantom_0 : :: std:: marker:: PhantomData < T > ,
12
+ }
Original file line number Diff line number Diff line change
1
+ // bindgen-flags: -- -x c++ --std=c++11
2
+
3
+ template <typename T>
4
+ struct Foo {
5
+ int bar;
6
+ };
You can’t perform that action at this time.
0 commit comments