File tree Expand file tree Collapse file tree 4 files changed +1
-29
lines changed
dev-tools/gen-windows-sys-binding Expand file tree Collapse file tree 4 files changed +1
-29
lines changed Original file line number Diff line number Diff line change @@ -7,4 +7,3 @@ publish = false
77[dependencies ]
88windows-bindgen = " 0.58"
99tempfile = " 3"
10- regex = " 1"
Original file line number Diff line number Diff line change @@ -6,8 +6,6 @@ use std::{
66 io:: { BufWriter , Write as _} ,
77} ;
88
9- use regex:: Regex ;
10-
119/// This is printed to the file before the rest of the contents.
1210const PRELUDE : & str = r#"// This file is autogenerated.
1311//
@@ -60,27 +58,6 @@ fn main() {
6058
6159 write ! ( & mut f, "{PRELUDE}\n {bindings}\n " ) . unwrap ( ) ;
6260
63- let mut dll_names: Vec < & str > = Regex :: new ( r#"link!\("(.*)\.dll""# )
64- . unwrap ( )
65- . captures_iter ( & bindings)
66- . map ( |caps| caps. extract ( ) . 1 )
67- . map ( |[ dll_name] | dll_name)
68- . filter ( |dll_name| * dll_name != "kernel32" )
69- . collect ( ) ;
70-
71- if !dll_names. is_empty ( ) {
72- dll_names. sort_unstable ( ) ;
73- dll_names. dedup ( ) ;
74-
75- for dll_name in dll_names {
76- write ! ( & mut f, r#"#[link(name = "{dll_name}")]"# ) . unwrap ( ) ;
77- f. write_all ( "\n " . as_bytes ( ) ) . unwrap ( ) ;
78- }
79-
80- f. write_all ( r#"extern "C" {}"# . as_bytes ( ) ) . unwrap ( ) ;
81- f. write_all ( "\n " . as_bytes ( ) ) . unwrap ( ) ;
82- }
83-
8461 f. write_all ( r#"use super::windows_targets;"# . as_bytes ( ) )
8562 . unwrap ( ) ;
8663 f. write_all ( "\n " . as_bytes ( ) ) . unwrap ( ) ;
Original file line number Diff line number Diff line change @@ -114,8 +114,4 @@ pub const WAIT_OBJECT_0: WAIT_EVENT = 0u32;
114114pub const WAIT_TIMEOUT : WAIT_EVENT = 258u32 ;
115115pub type WIN32_ERROR = u32 ;
116116
117- #[ link( name = "advapi32" ) ]
118- #[ link( name = "ole32" ) ]
119- #[ link( name = "oleaut32" ) ]
120- extern "C" { }
121117use super :: windows_targets;
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ macro_rules! link_macro {
99 // have in this repo. So instead we always link kernel32.lib and add the rest of the import
1010 // libraries below by using an empty extern block. This works because extern blocks are not
1111 // connected to the library given in the #[link] attribute.
12- #[ link( name = "kernel32" ) ]
12+ #[ link( name = "kernel32" , kind = "raw-dylib" ) ]
1313 extern $abi {
1414 $( #[ link_name=$link_name] ) ?
1515 pub fn $( $function) * ;
You can’t perform that action at this time.
0 commit comments