@@ -569,6 +569,10 @@ impl Builder {
569569 output_vector. push ( "--explicit-padding" . into ( ) ) ;
570570 }
571571
572+ if self . options . vtable_generation {
573+ output_vector. push ( "--vtable-generation" . into ( ) ) ;
574+ }
575+
572576 // Add clang arguments
573577
574578 output_vector. push ( "--" . into ( ) ) ;
@@ -1450,6 +1454,14 @@ impl Builder {
14501454 self
14511455 }
14521456
1457+ /// If true, enables experimental support to generate vtable functions.
1458+ ///
1459+ /// Should mostly work, though some edge cases are likely to be broken.
1460+ pub fn vtable_generation ( mut self , doit : bool ) -> Self {
1461+ self . options . vtable_generation = doit;
1462+ self
1463+ }
1464+
14531465 /// Generate the Rust bindings using the options built up thus far.
14541466 pub fn generate ( mut self ) -> Result < Bindings , BindgenError > {
14551467 // Add any extra arguments from the environment to the clang command line.
@@ -1981,6 +1993,9 @@ struct BindgenOptions {
19811993
19821994 /// Always output explicit padding fields
19831995 force_explicit_padding : bool ,
1996+
1997+ /// Emit vtable functions.
1998+ vtable_generation : bool ,
19841999}
19852000
19862001/// TODO(emilio): This is sort of a lie (see the error message that results from
@@ -2128,6 +2143,7 @@ impl Default for BindgenOptions {
21282143 translate_enum_integer_types : false ,
21292144 c_naming : false ,
21302145 force_explicit_padding : false ,
2146+ vtable_generation : false ,
21312147 }
21322148 }
21332149}
0 commit comments