File tree Expand file tree Collapse file tree 1 file changed +25
-3
lines changed Expand file tree Collapse file tree 1 file changed +25
-3
lines changed Original file line number Diff line number Diff line change 11//@ run-pass
2- #![ allow( dead_code) ]
32//@ pretty-expanded FIXME #23616
4- #![ feature( rustc_private) ]
53
6- extern crate libc;
4+ #![ allow( dead_code) ]
5+ #![ feature( rustc_private) ]
76
87mod bar {
98 extern "C" { }
@@ -13,14 +12,37 @@ mod zed {
1312 extern "C" { }
1413}
1514
15+ #[ cfg( not( windows) ) ]
1616mod mlibc {
17+ extern crate libc;
1718 use libc:: { c_int, c_void, size_t, ssize_t} ;
1819
1920 extern "C" {
2021 pub fn write ( fd : c_int , buf : * const c_void , count : size_t ) -> ssize_t ;
2122 }
2223}
2324
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+
2446mod baz {
2547 extern "C" { }
2648}
You can’t perform that action at this time.
0 commit comments