Forráskód Böngészése

Fix compile for new kernel

Jeremy Soller 8 éve
szülő
commit
65495da00f
2 módosított fájl, 4 hozzáadás és 0 törlés
  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() {