@@ -35,53 +35,6 @@ fn gen_wrapper(out_path: &Path) -> PathBuf {
35
35
wrapper_file
36
36
}
37
37
38
- #[ cfg( not( feature = "build-bindgen" ) ) ]
39
- fn gen_bindings ( ) {
40
- let out_path = PathBuf :: from ( & env:: var ( "OUT_DIR" ) . unwrap ( ) ) ;
41
-
42
- let wrapper_file = gen_wrapper ( & out_path) ;
43
-
44
- let mut bindgen = std:: process:: Command :: new ( "bindgen" ) ;
45
- bindgen
46
- . arg ( wrapper_file)
47
- . arg ( "--use-core" )
48
- . arg ( "--ctypes-prefix" )
49
- . arg ( "cty" )
50
- . arg ( "--no-layout-tests" )
51
- . arg ( "--default-enum-style=moduleconsts" )
52
- . arg ( "--no-doc-comments" )
53
- . arg ( "--whitelist-function" )
54
- . arg ( WHITELIST_REGEX_FUNCTION )
55
- . arg ( "--whitelist-type" )
56
- . arg ( WHITELIST_REGEX_TYPE )
57
- . arg ( "--whitelist-var" )
58
- . arg ( WHITELIST_REGEX_VAR )
59
- . arg ( "--no-derive-debug" ) ;
60
- for & ty in PRIMITIVES . iter ( ) {
61
- bindgen. arg ( "--blacklist-type" ) . arg ( ty) ;
62
- }
63
- bindgen
64
- . arg ( "-o" )
65
- . arg ( out_path. join ( "bindings.rs" ) . to_str ( ) . unwrap ( ) ) ;
66
- bindgen
67
- . arg ( "--" )
68
- . arg ( format ! (
69
- "-Dd_m3Use32BitSlots={}" ,
70
- if cfg!( feature = "use-32bit-slots" ) {
71
- 1
72
- } else {
73
- 0
74
- }
75
- ) )
76
- . arg ( "-Dd_m3LogOutput=0" )
77
- . arg ( "-Iwasm3/source" ) ;
78
- let status = bindgen. status ( ) . expect ( "Unable to generate bindings" ) ;
79
- if !status. success ( ) {
80
- panic ! ( "Failed to run bindgen: {:?}" , status) ;
81
- }
82
- }
83
-
84
- #[ cfg( feature = "build-bindgen" ) ]
85
38
fn gen_bindings ( ) {
86
39
let out_path = PathBuf :: from ( env:: var ( "OUT_DIR" ) . unwrap ( ) ) ;
87
40
@@ -94,13 +47,15 @@ fn gen_bindings() {
94
47
. layout_tests ( false )
95
48
. default_enum_style ( bindgen:: EnumVariation :: ModuleConsts )
96
49
. generate_comments ( false )
97
- . whitelist_function ( WHITELIST_REGEX_FUNCTION )
98
- . whitelist_type ( WHITELIST_REGEX_TYPE )
99
- . whitelist_var ( WHITELIST_REGEX_VAR )
50
+ . allowlist_function ( WHITELIST_REGEX_FUNCTION )
51
+ . allowlist_type ( WHITELIST_REGEX_TYPE )
52
+ . allowlist_var ( WHITELIST_REGEX_VAR )
100
53
. derive_debug ( false ) ;
54
+
101
55
bindgen = PRIMITIVES
102
56
. iter ( )
103
- . fold ( bindgen, |bindgen, ty| bindgen. blacklist_type ( ty) ) ;
57
+ . fold ( bindgen, |bindgen, ty| bindgen. blocklist_type ( ty) ) ;
58
+
104
59
bindgen
105
60
. clang_args (
106
61
[
0 commit comments