@@ -358,6 +358,7 @@ impl Builder {
358
358
( & self . options . no_default_types , "--no-default" ) ,
359
359
( & self . options . no_hash_types , "--no-hash" ) ,
360
360
( & self . options . must_use_types , "--must-use-type" ) ,
361
+ ( & self . options . remove_alias , "--remove-alias" ) ,
361
362
] ;
362
363
363
364
for ( set, flag) in regex_sets {
@@ -1770,6 +1771,13 @@ impl Builder {
1770
1771
self . options . c_naming = doit;
1771
1772
self
1772
1773
}
1774
+
1775
+ /// Remove a type alias that matches the provided argument. Regular
1776
+ /// expressions are supported.
1777
+ pub fn remove_alias < T : Into < String > > ( mut self , arg : T ) -> Self {
1778
+ self . options . remove_alias . insert ( arg. into ( ) ) ;
1779
+ self
1780
+ }
1773
1781
}
1774
1782
1775
1783
/// Configuration options for generated bindings.
@@ -2105,6 +2113,9 @@ struct BindgenOptions {
2105
2113
2106
2114
/// Deduplicate `extern` blocks.
2107
2115
merge_extern_blocks : bool ,
2116
+
2117
+ /// The set of type aliases that should be removed.
2118
+ remove_alias : RegexSet ,
2108
2119
}
2109
2120
2110
2121
/// TODO(emilio): This is sort of a lie (see the error message that results from
@@ -2142,6 +2153,7 @@ impl BindgenOptions {
2142
2153
& mut self . no_default_types ,
2143
2154
& mut self . no_hash_types ,
2144
2155
& mut self . must_use_types ,
2156
+ & mut self . remove_alias ,
2145
2157
] ;
2146
2158
let record_matches = self . record_matches ;
2147
2159
for regex_set in & mut regex_sets {
@@ -2261,6 +2273,7 @@ impl Default for BindgenOptions {
2261
2273
vtable_generation : false ,
2262
2274
sort_semantically : false ,
2263
2275
merge_extern_blocks : false ,
2276
+ remove_alias : Default :: default ( ) ,
2264
2277
}
2265
2278
}
2266
2279
}
0 commit comments