File tree 4 files changed +1
-29
lines changed
dev-tools/gen-windows-sys-binding
4 files changed +1
-29
lines changed Original file line number Diff line number Diff line change @@ -7,4 +7,3 @@ publish = false
7
7
[dependencies ]
8
8
windows-bindgen = " 0.58"
9
9
tempfile = " 3"
10
- regex = " 1"
Original file line number Diff line number Diff line change @@ -6,8 +6,6 @@ use std::{
6
6
io:: { BufWriter , Write as _} ,
7
7
} ;
8
8
9
- use regex:: Regex ;
10
-
11
9
/// This is printed to the file before the rest of the contents.
12
10
const PRELUDE : & str = r#"// This file is autogenerated.
13
11
//
@@ -60,27 +58,6 @@ fn main() {
60
58
61
59
write ! ( & mut f, "{PRELUDE}\n {bindings}\n " ) . unwrap ( ) ;
62
60
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
-
84
61
f. write_all ( r#"use super::windows_targets;"# . as_bytes ( ) )
85
62
. unwrap ( ) ;
86
63
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;
114
114
pub const WAIT_TIMEOUT : WAIT_EVENT = 258u32 ;
115
115
pub type WIN32_ERROR = u32 ;
116
116
117
- #[ link( name = "advapi32" ) ]
118
- #[ link( name = "ole32" ) ]
119
- #[ link( name = "oleaut32" ) ]
120
- extern "C" { }
121
117
use super :: windows_targets;
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ macro_rules! link_macro {
9
9
// have in this repo. So instead we always link kernel32.lib and add the rest of the import
10
10
// libraries below by using an empty extern block. This works because extern blocks are not
11
11
// connected to the library given in the #[link] attribute.
12
- #[ link( name = "kernel32" ) ]
12
+ #[ link( name = "kernel32" , kind = "raw-dylib" ) ]
13
13
extern $abi {
14
14
$( #[ link_name=$link_name] ) ?
15
15
pub fn $( $function) * ;
You can’t perform that action at this time.
0 commit comments