@@ -2184,102 +2184,113 @@ impl BindgenOptions {
2184
2184
2185
2185
impl Default for BindgenOptions {
2186
2186
fn default ( ) -> BindgenOptions {
2187
+ macro_rules! options {
2188
+ ( $( $field: ident : $value: expr, ) * --default -fields-- $( $default_field: ident, ) * ) => {
2189
+ BindgenOptions {
2190
+ $( $field: $value, ) *
2191
+ $( $default_field: Default :: default ( ) , ) *
2192
+ }
2193
+ } ;
2194
+ }
2195
+
2187
2196
let rust_target = RustTarget :: default ( ) ;
2188
2197
2189
- BindgenOptions {
2190
- rust_target,
2198
+ options ! {
2199
+ rust_target: rust_target ,
2191
2200
rust_features: rust_target. into( ) ,
2192
- blocklisted_types : Default :: default ( ) ,
2193
- blocklisted_functions : Default :: default ( ) ,
2194
- blocklisted_items : Default :: default ( ) ,
2195
- blocklisted_files : Default :: default ( ) ,
2196
- opaque_types : Default :: default ( ) ,
2197
- rustfmt_path : Default :: default ( ) ,
2198
- depfile : Default :: default ( ) ,
2199
- allowlisted_types : Default :: default ( ) ,
2200
- allowlisted_functions : Default :: default ( ) ,
2201
- allowlisted_vars : Default :: default ( ) ,
2202
- allowlisted_files : Default :: default ( ) ,
2203
- default_enum_style : Default :: default ( ) ,
2204
- bitfield_enums : Default :: default ( ) ,
2205
- newtype_enums : Default :: default ( ) ,
2206
- newtype_global_enums : Default :: default ( ) ,
2207
- rustified_enums : Default :: default ( ) ,
2208
- rustified_non_exhaustive_enums : Default :: default ( ) ,
2209
- constified_enums : Default :: default ( ) ,
2210
- constified_enum_modules : Default :: default ( ) ,
2211
- default_macro_constant_type : Default :: default ( ) ,
2212
- default_alias_style : Default :: default ( ) ,
2213
- type_alias : Default :: default ( ) ,
2214
- new_type_alias : Default :: default ( ) ,
2215
- new_type_alias_deref : Default :: default ( ) ,
2216
- default_non_copy_union_style : Default :: default ( ) ,
2217
- bindgen_wrapper_union : Default :: default ( ) ,
2218
- manually_drop_union : Default :: default ( ) ,
2219
- builtins : false ,
2220
- emit_ast : false ,
2221
- emit_ir : false ,
2222
- emit_ir_graphviz : None ,
2223
2201
layout_tests: true ,
2224
- impl_debug : false ,
2225
- impl_partialeq : false ,
2226
2202
derive_copy: true ,
2227
2203
derive_debug: true ,
2228
- derive_default : false ,
2229
- derive_hash : false ,
2230
- derive_partialord : false ,
2231
- derive_ord : false ,
2232
- derive_partialeq : false ,
2233
- derive_eq : false ,
2234
- enable_cxx_namespaces : false ,
2235
- enable_function_attribute_detection : false ,
2236
- disable_name_namespacing : false ,
2237
- disable_nested_struct_naming : false ,
2238
- disable_header_comment : false ,
2239
- use_core : false ,
2240
- ctypes_prefix : None ,
2241
2204
anon_fields_prefix: DEFAULT_ANON_FIELDS_PREFIX . into( ) ,
2242
2205
convert_floats: true ,
2243
- raw_lines : vec ! [ ] ,
2244
- module_lines : HashMap :: default ( ) ,
2245
- clang_args : vec ! [ ] ,
2246
- input_headers : vec ! [ ] ,
2247
- input_header_contents : Default :: default ( ) ,
2248
- parse_callbacks : Default :: default ( ) ,
2249
2206
codegen_config: CodegenConfig :: all( ) ,
2250
- conservative_inline_namespaces : false ,
2251
2207
generate_comments: true ,
2252
- generate_inline_functions : false ,
2253
2208
allowlist_recursively: true ,
2254
- generate_block : false ,
2255
- objc_extern_crate : false ,
2256
- block_extern_crate : false ,
2257
2209
enable_mangling: true ,
2258
2210
detect_include_paths: true ,
2259
- fit_macro_constants : false ,
2260
2211
prepend_enum_name: true ,
2261
- time_phases : false ,
2262
2212
record_matches: true ,
2263
2213
rustfmt_bindings: true ,
2264
2214
size_t_is_usize: true ,
2265
- rustfmt_configuration_file : None ,
2266
- no_partialeq_types : Default :: default ( ) ,
2267
- no_copy_types : Default :: default ( ) ,
2268
- no_debug_types : Default :: default ( ) ,
2269
- no_default_types : Default :: default ( ) ,
2270
- no_hash_types : Default :: default ( ) ,
2271
- must_use_types : Default :: default ( ) ,
2272
- array_pointers_in_arguments : false ,
2273
- wasm_import_module_name : None ,
2274
- dynamic_library_name : None ,
2275
- dynamic_link_require_all : false ,
2276
- respect_cxx_access_specs : false ,
2277
- translate_enum_integer_types : false ,
2278
- c_naming : false ,
2279
- force_explicit_padding : false ,
2280
- vtable_generation : false ,
2281
- sort_semantically : false ,
2282
- merge_extern_blocks : false ,
2215
+
2216
+ --default -fields--
2217
+ blocklisted_types,
2218
+ blocklisted_functions,
2219
+ blocklisted_items,
2220
+ blocklisted_files,
2221
+ opaque_types,
2222
+ rustfmt_path,
2223
+ depfile,
2224
+ allowlisted_types,
2225
+ allowlisted_functions,
2226
+ allowlisted_vars,
2227
+ allowlisted_files,
2228
+ default_enum_style,
2229
+ bitfield_enums,
2230
+ newtype_enums,
2231
+ newtype_global_enums,
2232
+ rustified_enums,
2233
+ rustified_non_exhaustive_enums,
2234
+ constified_enums,
2235
+ constified_enum_modules,
2236
+ default_macro_constant_type,
2237
+ default_alias_style,
2238
+ type_alias,
2239
+ new_type_alias,
2240
+ new_type_alias_deref,
2241
+ default_non_copy_union_style,
2242
+ bindgen_wrapper_union,
2243
+ manually_drop_union,
2244
+ builtins,
2245
+ emit_ast,
2246
+ emit_ir,
2247
+ emit_ir_graphviz,
2248
+ impl_debug,
2249
+ impl_partialeq,
2250
+ derive_default,
2251
+ derive_hash,
2252
+ derive_partialord,
2253
+ derive_ord,
2254
+ derive_partialeq,
2255
+ derive_eq,
2256
+ enable_cxx_namespaces,
2257
+ enable_function_attribute_detection,
2258
+ disable_name_namespacing,
2259
+ disable_nested_struct_naming,
2260
+ disable_header_comment,
2261
+ use_core,
2262
+ ctypes_prefix,
2263
+ raw_lines,
2264
+ module_lines,
2265
+ clang_args,
2266
+ input_headers,
2267
+ input_header_contents,
2268
+ parse_callbacks,
2269
+ conservative_inline_namespaces,
2270
+ generate_inline_functions,
2271
+ generate_block,
2272
+ objc_extern_crate,
2273
+ block_extern_crate,
2274
+ fit_macro_constants,
2275
+ time_phases,
2276
+ rustfmt_configuration_file,
2277
+ no_partialeq_types,
2278
+ no_copy_types,
2279
+ no_debug_types,
2280
+ no_default_types,
2281
+ no_hash_types,
2282
+ must_use_types,
2283
+ array_pointers_in_arguments,
2284
+ wasm_import_module_name,
2285
+ dynamic_library_name,
2286
+ dynamic_link_require_all,
2287
+ respect_cxx_access_specs,
2288
+ translate_enum_integer_types,
2289
+ c_naming,
2290
+ force_explicit_padding,
2291
+ vtable_generation,
2292
+ sort_semantically,
2293
+ merge_extern_blocks,
2283
2294
}
2284
2295
}
2285
2296
}
0 commit comments