File tree 1 file changed +25
-3
lines changed
1 file changed +25
-3
lines changed Original file line number Diff line number Diff line change 1
1
//@ run-pass
2
- #![ allow( dead_code) ]
3
2
//@ pretty-expanded FIXME #23616
4
- #![ feature( rustc_private) ]
5
3
6
- extern crate libc;
4
+ #![ allow( dead_code) ]
5
+ #![ feature( rustc_private) ]
7
6
8
7
mod bar {
9
8
extern "C" { }
@@ -13,14 +12,37 @@ mod zed {
13
12
extern "C" { }
14
13
}
15
14
15
+ #[ cfg( not( windows) ) ]
16
16
mod mlibc {
17
+ extern crate libc;
17
18
use libc:: { c_int, c_void, size_t, ssize_t} ;
18
19
19
20
extern "C" {
20
21
pub fn write ( fd : c_int , buf : * const c_void , count : size_t ) -> ssize_t ;
21
22
}
22
23
}
23
24
25
+ #[ cfg( windows) ]
26
+ mod mlibc {
27
+ #![ allow( non_snake_case) ]
28
+
29
+ use std:: ffi:: c_void;
30
+
31
+ pub type BOOL = i32 ;
32
+ pub type HANDLE = * mut c_void ;
33
+
34
+ #[ link( name = "ntdll" ) ]
35
+ extern "system" {
36
+ pub fn WriteFile (
37
+ hfile : HANDLE ,
38
+ lpbuffer : * const u8 ,
39
+ nnumberofbytestowrite : u32 ,
40
+ lpnumberofbyteswritten : * mut u32 ,
41
+ lpoverlapped : * mut c_void ,
42
+ ) -> BOOL ;
43
+ }
44
+ }
45
+
24
46
mod baz {
25
47
extern "C" { }
26
48
}
You can’t perform that action at this time.
0 commit comments