@@ -427,36 +427,45 @@ fn main() {
427427 let out_dir = env:: var ( "OUT_DIR" ) . unwrap ( ) ;
428428 let dummy_c = Path :: new ( & out_dir) . join ( "dummy.c" ) ;
429429 std:: fs:: write ( & dummy_c, "int main() { return 0; }" ) . unwrap ( ) ;
430-
430+
431431 // Use cc crate to get compiler with proper environment setup
432432 let mut build = cc:: Build :: new ( ) ;
433433 build. file ( & dummy_c) ;
434-
434+
435435 // Get the actual compiler command cc would use
436436 let compiler = build. try_get_compiler ( ) . unwrap ( ) ;
437-
437+
438438 // Extract include paths by checking compiler's environment
439439 // cc crate sets up MSVC environment internally
440- let env_include = compiler. env ( ) . iter ( )
440+ let env_include = compiler
441+ . env ( )
442+ . iter ( )
441443 . find ( |( k, _) | k. eq_ignore_ascii_case ( "INCLUDE" ) )
442444 . map ( |( _, v) | v) ;
443-
445+
444446 if let Some ( include_paths) = env_include {
445- for include_path in include_paths. to_string_lossy ( ) . split ( ';' ) . filter ( |s| !s. is_empty ( ) ) {
447+ for include_path in include_paths
448+ . to_string_lossy ( )
449+ . split ( ';' )
450+ . filter ( |s| !s. is_empty ( ) )
451+ {
446452 bindings_builder = bindings_builder
447453 . clang_arg ( "-isystem" )
448454 . clang_arg ( include_path) ;
449455 debug_log ! ( "Added MSVC include path: {}" , include_path) ;
450456 }
451457 }
452-
458+
453459 // Add MSVC compatibility flags
454460 bindings_builder = bindings_builder
455461 . clang_arg ( format ! ( "--target={}" , target_triple) )
456462 . clang_arg ( "-fms-compatibility" )
457463 . clang_arg ( "-fms-extensions" ) ;
458464
459- debug_log ! ( "Configured bindgen with MSVC toolchain for target: {}" , target_triple) ;
465+ debug_log ! (
466+ "Configured bindgen with MSVC toolchain for target: {}" ,
467+ target_triple
468+ ) ;
460469 }
461470 let bindings = bindings_builder
462471 . generate ( )
0 commit comments