diff options
| author | bjorn3 <bjorn3@users.noreply.github.com> | 2020-06-16 11:50:58 +0200 |
|---|---|---|
| committer | bjorn3 <bjorn3@users.noreply.github.com> | 2020-06-16 11:50:58 +0200 |
| commit | d4187e6aae855f16651aca4973839aec8c58eb29 (patch) | |
| tree | 7dcf423981fadf200b3b719366b9189a36647a38 /example/mini_core.rs | |
| parent | 282e3055e1f00b53e8653fb037b7f2b31d57545e (diff) | |
| download | rust-d4187e6aae855f16651aca4973839aec8c58eb29.tar.gz rust-d4187e6aae855f16651aca4973839aec8c58eb29.zip | |
Make mini_core_hello_world work on Windows once TLS is supported
Diffstat (limited to 'example/mini_core.rs')
| -rw-r--r-- | example/mini_core.rs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/example/mini_core.rs b/example/mini_core.rs index 2732c6902b1..ccca19ccf8c 100644 --- a/example/mini_core.rs +++ b/example/mini_core.rs @@ -403,7 +403,7 @@ pub trait FnMut<Args>: FnOnce<Args> { #[track_caller] pub fn panic(_msg: &str) -> ! { unsafe { - libc::puts("Panicking\n\0" as *const str as *const u8); + libc::puts("Panicking\n\0" as *const str as *const i8); intrinsics::abort(); } } @@ -502,9 +502,10 @@ pub mod intrinsics { } pub mod libc { - #[link(name = "c")] + #[cfg_attr(not(windows), link(name = "c"))] + #[cfg_attr(windows, link(name = "msvcrt"))] extern "C" { - pub fn puts(s: *const u8) -> i32; + pub fn puts(s: *const i8) -> i32; pub fn printf(format: *const i8, ...) -> i32; pub fn malloc(size: usize) -> *mut u8; pub fn free(ptr: *mut u8); |
