瀏覽代碼

Fix compile for new kernel

Jeremy Soller 8 年之前
父節點
當前提交
65495da00f
共有 2 個文件被更改,包括 4 次插入0 次删除
  1. 3 0
      Cargo.toml
  2. 1 0
      src/sys.rs

+ 3 - 0
Cargo.toml

@@ -46,3 +46,6 @@ tls = []
 unsafe_no_brk_lock = []
 unsafe_no_mutex_lock = []
 write = []
+
+[replace]
+"libc:0.2.16" = { git = "https://github.com/redox-os/liblibc.git", branch = "new_kernel" }

+ 1 - 0
src/sys.rs

@@ -47,6 +47,7 @@ pub fn yield_now() {
 /// shipped with the destructor.
 // TODO: I haven't figured out a safe general solution yet. Libstd relies on devirtualization,
 // which, when missed, can make it quite expensive.
+#[cfg(feature = "tls")]
 pub fn register_thread_destructor<T>(load: *mut T, dtor: extern fn(*mut T)) -> Result<(), ()> {
     // Check if thread dtors are supported.
     if shim::thread_destructor::is_supported() {