yjh0502 / rust-s2

S2 geometry library in Rust
Apache License 2.0
77 stars 20 forks source link

Does not compile to wasm #5

Closed That3Percent closed 5 years ago

That3Percent commented 5 years ago

I'm trying to use this library in WebAssembly, compiled via wasm-pack. It seems that it gets hung up on the float-extras crate with...

unresolved imports `libc::c_double`, `libc::c_int`                                                      
 --> github.com-1ecc6299db9ec823\float_extras-0.1.6\src\lib.rs:5:16
  |
5 |     use libc::{c_double, c_int};
  |                ^^^^^^^^  ^^^^^ no `c_int` in the root
  |                |
  |                no `c_double` in the root

Would it be possible to either not require this dependency, or to gate the functionality that uses this behind a feature flag so I can get some basic functionality like CellID?

That3Percent commented 5 years ago

Curiously, compiling from source does not have this problem since float-extras is not listed in Cargo.toml for the current version. So, I think all that would be needed to close this issue would be to package up and publish a new version.

yjh0502 commented 5 years ago

Related https://github.com/yjh0502/float_extras/issues/1

yjh0502 commented 5 years ago

s2 0.0.9 is just published, https://crates.io/crates/s2. Thanks for the report!

That3Percent commented 5 years ago

Works great! Thanks, and please accept this github star as a token of my appreciation.