Skip to content

Instantly share code, notes, and snippets.

@wehlutyk
Created July 2, 2018 13:16
Show Gist options
  • Save wehlutyk/707fc841e290b490b963ce51552cc629 to your computer and use it in GitHub Desktop.
Save wehlutyk/707fc841e290b490b963ce51552cc629 to your computer and use it in GitHub Desktop.
diff --git a/Cargo.toml b/Cargo.toml
index 3d89a93..4b6d09c 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -24,7 +24,7 @@ miniz-sys = { path = "miniz-sys", version = "0.1.7", optional = true }
libz-sys = { version = "1.0", optional = true }
tokio-io = { version = "0.1", optional = true }
futures = { version = "0.1", optional = true }
-miniz_oxide_c_api = { version = "0.1", optional = true, features = ["no_c_export"]}
+miniz_oxide_c_api = { path = "../miniz_oxide", optional = true, features = ["no_c_export"]}
[dev-dependencies]
rand = "0.4"
diff --git a/src/lib.rs b/src/lib.rs
index 47013e0..3a04dac 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -78,7 +78,17 @@
#[cfg(feature = "tokio")]
extern crate futures;
+#[cfg(not(all(target_arch = "wasm32", not(target_os = "emscripten"))))]
extern crate libc;
+#[cfg(all(target_arch = "wasm32", not(target_os = "emscripten")))]
+mod libc {
+ #![allow(non_camel_case_types)]
+ pub type c_ulong = u64;
+ pub type off_t = i64;
+ pub type c_int = i32;
+ pub type c_uint = u32;
+ pub type size_t = usize;
+}
#[cfg(test)]
extern crate quickcheck;
#[cfg(test)]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment