File tree Expand file tree Collapse file tree 3 files changed +30
-1
lines changed Expand file tree Collapse file tree 3 files changed +30
-1
lines changed 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
+ extern crate core;
7
+
8
+ #[ repr( C ) ]
9
+ #[ derive( Debug , Copy ) ]
10
+ pub struct foo {
11
+ pub a : :: std:: os:: raw:: c_int ,
12
+ pub b : :: std:: os:: raw:: c_int ,
13
+ pub bar : * mut :: std:: os:: raw:: c_void ,
14
+ }
15
+ #[ test]
16
+ fn bindgen_test_layout_foo ( ) {
17
+ assert_eq ! ( :: core:: mem:: size_of:: <foo>( ) , 16usize ) ;
18
+ assert_eq ! ( :: core:: mem:: align_of:: <foo>( ) , 8usize ) ;
19
+ }
20
+ impl Clone for foo {
21
+ fn clone ( & self ) -> Self { * self }
22
+ }
Original file line number Diff line number Diff line change
1
+ // bindgen-flags: --use-core --raw-line "extern crate core;"
2
+
3
+ struct foo {
4
+ int a , b ;
5
+ void * bar ;
6
+ };
Original file line number Diff line number Diff line change 8
8
import sys
9
9
import subprocess
10
10
import tempfile
11
+ import shlex
11
12
12
13
BINDGEN_FLAGS_PREFIX = "// bindgen-flags: "
13
14
@@ -94,7 +95,7 @@ def get_bindgen_flags(header_path):
94
95
with open (header_path ) as f :
95
96
for line in f :
96
97
if line .startswith (BINDGEN_FLAGS_PREFIX ):
97
- flags .extend (line .strip ().split (BINDGEN_FLAGS_PREFIX )[1 ]. split ( " " ))
98
+ flags .extend (shlex . split ( line .strip ().split (BINDGEN_FLAGS_PREFIX )[1 ]))
98
99
break
99
100
100
101
return flags
You can’t perform that action at this time.
0 commit comments