about summary refs log tree commit diff
path: root/example/alloc_example.rs
diff options
context:
space:
mode:
Diffstat (limited to 'example/alloc_example.rs')
-rw-r--r--example/alloc_example.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/example/alloc_example.rs b/example/alloc_example.rs
index dc2ad4c676e..f59600ebb33 100644
--- a/example/alloc_example.rs
+++ b/example/alloc_example.rs
@@ -11,7 +11,8 @@ use alloc_system::System;
 #[global_allocator]
 static ALLOC: System = System;
 
-#[link(name = "c")]
+#[cfg_attr(unix, link(name = "c"))]
+#[cfg_attr(target_env = "msvc", link(name = "msvcrt"))]
 extern "C" {
     fn puts(s: *const u8) -> i32;
 }