File tree 1 file changed +6
-1
lines changed
1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -19,7 +19,10 @@ Note that the default features have been disabled. This is a critical step -
19
19
disabled.**
20
20
21
21
Alternatively, we can use the unstable ` rustc_private ` private feature together
22
- with an ` extern crate libc; ` declaration as shown in the examples below.
22
+ with an ` extern crate libc; ` declaration as shown in the examples below. Note that
23
+ windows-msvc targets do not require a libc, and correspondingly there is no ` libc `
24
+ crate in their sysroot. We not need the ` extern crate libc; ` below, and having it
25
+ on a windows-msvc target would be a compile error.
23
26
24
27
## Writing an executable without ` std `
25
28
@@ -44,6 +47,7 @@ in the same format as C (aside from the exact integer types being used):
44
47
extern crate unwind;
45
48
46
49
// Pull in the system libc library for what crt0.o likely requires.
50
+ #[cfg(not(windows))]
47
51
extern crate libc;
48
52
49
53
use core :: panic :: PanicInfo ;
@@ -78,6 +82,7 @@ compiler's name mangling too:
78
82
extern crate unwind;
79
83
80
84
// Pull in the system libc library for what crt0.o likely requires.
85
+ #[cfg(not(windows))]
81
86
extern crate libc;
82
87
83
88
use core :: ffi :: {c_char, c_int};
You can’t perform that action at this time.
0 commit comments