@@ -83,10 +83,18 @@ impl TypeParser for CoreTypeParser {
8383 platform : & Platform ,
8484 existing_types : & TypeContainer ,
8585 options : & [ String ] ,
86- include_dirs : & [ String ] ,
86+ include_directories : & [ String ] ,
8787 ) -> Result < String , Vec < TypeParserError > > {
8888 let source_cstr = BnString :: new ( source) ;
8989 let file_name_cstr = BnString :: new ( file_name) ;
90+ let options: Vec < _ > = options. into_iter ( ) . map ( |o| o. to_cstr ( ) ) . collect ( ) ;
91+ let options_raw: Vec < * const c_char > = options. iter ( ) . map ( |o| o. as_ptr ( ) ) . collect ( ) ;
92+ let include_directories: Vec < _ > = include_directories
93+ . into_iter ( )
94+ . map ( |d| d. to_cstr ( ) )
95+ . collect ( ) ;
96+ let include_directories_raw: Vec < * const c_char > =
97+ include_directories. iter ( ) . map ( |d| d. as_ptr ( ) ) . collect ( ) ;
9098 let mut result = std:: ptr:: null_mut ( ) ;
9199 let mut errors = std:: ptr:: null_mut ( ) ;
92100 let mut error_count = 0 ;
@@ -97,10 +105,10 @@ impl TypeParser for CoreTypeParser {
97105 file_name_cstr. as_ptr ( ) ,
98106 platform. handle ,
99107 existing_types. handle . as_ptr ( ) ,
100- options . as_ptr ( ) as * const * const c_char ,
101- options . len ( ) ,
102- include_dirs . as_ptr ( ) as * const * const c_char ,
103- include_dirs . len ( ) ,
108+ options_raw . as_ptr ( ) as * const * const c_char ,
109+ options_raw . len ( ) ,
110+ include_directories_raw . as_ptr ( ) as * const * const c_char ,
111+ include_directories_raw . len ( ) ,
104112 & mut result,
105113 & mut errors,
106114 & mut error_count,
@@ -123,11 +131,19 @@ impl TypeParser for CoreTypeParser {
123131 platform : & Platform ,
124132 existing_types : & TypeContainer ,
125133 options : & [ String ] ,
126- include_dirs : & [ String ] ,
134+ include_directories : & [ String ] ,
127135 auto_type_source : & str ,
128136 ) -> Result < TypeParserResult , Vec < TypeParserError > > {
129137 let source_cstr = BnString :: new ( source) ;
130138 let file_name_cstr = BnString :: new ( file_name) ;
139+ let options: Vec < _ > = options. into_iter ( ) . map ( |o| o. to_cstr ( ) ) . collect ( ) ;
140+ let options_raw: Vec < * const c_char > = options. iter ( ) . map ( |o| o. as_ptr ( ) ) . collect ( ) ;
141+ let include_directories: Vec < _ > = include_directories
142+ . into_iter ( )
143+ . map ( |d| d. to_cstr ( ) )
144+ . collect ( ) ;
145+ let include_directories_raw: Vec < * const c_char > =
146+ include_directories. iter ( ) . map ( |d| d. as_ptr ( ) ) . collect ( ) ;
131147 let auto_type_source = BnString :: new ( auto_type_source) ;
132148 let mut raw_result = BNTypeParserResult :: default ( ) ;
133149 let mut errors = std:: ptr:: null_mut ( ) ;
@@ -139,10 +155,10 @@ impl TypeParser for CoreTypeParser {
139155 file_name_cstr. as_ptr ( ) ,
140156 platform. handle ,
141157 existing_types. handle . as_ptr ( ) ,
142- options . as_ptr ( ) as * const * const c_char ,
143- options . len ( ) ,
144- include_dirs . as_ptr ( ) as * const * const c_char ,
145- include_dirs . len ( ) ,
158+ options_raw . as_ptr ( ) as * const * const c_char ,
159+ options_raw . len ( ) ,
160+ include_directories_raw . as_ptr ( ) as * const * const c_char ,
161+ include_directories_raw . len ( ) ,
146162 auto_type_source. as_ptr ( ) ,
147163 & mut raw_result,
148164 & mut errors,
0 commit comments