@@ -358,6 +358,7 @@ impl Builder {
358358 ( & self . options . no_default_types , "--no-default" ) ,
359359 ( & self . options . no_hash_types , "--no-hash" ) ,
360360 ( & self . options . must_use_types , "--must-use-type" ) ,
361+ ( & self . options . remove_alias , "--remove-alias" ) ,
361362 ] ;
362363
363364 for ( set, flag) in regex_sets {
@@ -1770,6 +1771,13 @@ impl Builder {
17701771 self . options . c_naming = doit;
17711772 self
17721773 }
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+ }
17731781}
17741782
17751783/// Configuration options for generated bindings.
@@ -2105,6 +2113,9 @@ struct BindgenOptions {
21052113
21062114 /// Deduplicate `extern` blocks.
21072115 merge_extern_blocks : bool ,
2116+
2117+ /// The set of type aliases that should be removed.
2118+ remove_alias : RegexSet ,
21082119}
21092120
21102121/// TODO(emilio): This is sort of a lie (see the error message that results from
@@ -2142,6 +2153,7 @@ impl BindgenOptions {
21422153 & mut self . no_default_types ,
21432154 & mut self . no_hash_types ,
21442155 & mut self . must_use_types ,
2156+ & mut self . remove_alias ,
21452157 ] ;
21462158 let record_matches = self . record_matches ;
21472159 for regex_set in & mut regex_sets {
@@ -2261,6 +2273,7 @@ impl Default for BindgenOptions {
22612273 vtable_generation : false ,
22622274 sort_semantically : false ,
22632275 merge_extern_blocks : false ,
2276+ remove_alias : Default :: default ( ) ,
22642277 }
22652278 }
22662279}
0 commit comments