Remove libc dependency on non-Unix platforms
diff --git a/Cargo.toml b/Cargo.toml
index 62c7dee..01713a2 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -12,7 +12,7 @@
 categories = ["asynchronous", "concurrency"]
 readme = "README.md"
 
-[dependencies]
+[target.'cfg(unix)'.dependencies]
 libc = "0.2.66"
 
 [target.'cfg(windows)'.dependencies]
diff --git a/src/raw.rs b/src/raw.rs
index c783d26..1440e7e 100644
--- a/src/raw.rs
+++ b/src/raw.rs
@@ -10,7 +10,7 @@
 
 use crate::header::Header;
 use crate::state::*;
-use crate::utils::{abort_on_panic, extend};
+use crate::utils::{abort, abort_on_panic, extend};
 use crate::Task;
 
 /// The vtable for a task.
@@ -111,7 +111,7 @@
         unsafe {
             // Allocate enough space for the entire task.
             let raw_task = match NonNull::new(alloc::alloc::alloc(task_layout.layout) as *mut ()) {
-                None => libc::abort(),
+                None => abort(),
                 Some(p) => p,
             };
 
@@ -311,7 +311,7 @@
                         if state & RUNNING == 0 {
                             // If the reference count overflowed, abort.
                             if state > isize::max_value() as usize {
-                                libc::abort();
+                                abort();
                             }
 
                             // Schedule the task. There is no need to call `Self::schedule(ptr)`
@@ -343,7 +343,7 @@
 
         // If the reference count overflowed, abort.
         if state > isize::max_value() as usize {
-            libc::abort();
+            abort();
         }
 
         RawWaker::new(ptr, raw_waker_vtable)
diff --git a/src/task.rs b/src/task.rs
index b26c082..8ef209c 100644
--- a/src/task.rs
+++ b/src/task.rs
@@ -101,6 +101,7 @@
 /// // Create a task with the future and the schedule function.
 /// let (task, handle) = async_task::spawn_local(future, schedule, ());
 /// ```
+#[cfg(any(unix, windows))]
 pub fn spawn_local<F, R, S, T>(future: F, schedule: S, tag: T) -> (Task<T>, JoinHandle<R, T>)
 where
     F: Future<Output = R> + 'static,
diff --git a/src/utils.rs b/src/utils.rs
index 7c71deb..cb9b65e 100644
--- a/src/utils.rs
+++ b/src/utils.rs
@@ -1,6 +1,22 @@
 use core::alloc::Layout;
 use core::mem;
 
+/// Aborts the process.
+///
+/// To abort, this function simply panics while panicking.
+pub(crate) fn abort() -> ! {
+    struct Panic;
+
+    impl Drop for Panic {
+        fn drop(&mut self) {
+            panic!("aborting the process");
+        }
+    }
+
+    let _panic = Panic;
+    panic!("aborting the process");
+}
+
 /// Calls a function and aborts if it panics.
 ///
 /// This is useful in unsafe code where we can't recover from panics.
@@ -10,7 +26,7 @@
 
     impl Drop for Bomb {
         fn drop(&mut self) {
-            unsafe { libc::abort() }
+            abort();
         }
     }