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