jerel / membrane

Membrane is an opinionated crate that generates a Dart package from a Rust library. Extremely fast performance with strict typing and zero copy returns over the FFI boundary via bincode.
Apache License 2.0
89 stars 12 forks source link

Support i64 type on windows target #41

Closed ghost closed 1 year ago

ghost commented 1 year ago
#[membrane::sync_dart(namespace = "example")]
pub fn for_example(
    random: i64
) -> Result<(), ()> {
    println!("For example: {random}");
    Ok(())
}

When I try to cargo build --target x86_64-pc-windows-gnu this code, I get the following error:

error[E0308]: mismatched types
 --> src/lib.rs:1:1
  |
1 | #[membrane::sync_dart(namespace = "example")]
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `i64`, found `i32`
2 | pub fn for_example(
  |        ----------- arguments to this function are incorrect
  |
note: function defined here
 --> src/lib.rs:2:8
  |
2 | pub fn for_example(
  |        ^^^^^^^^^^^
3 |     random: i64
  |     -----------
  = note: this error originates in the attribute macro `membrane::sync_dart` (in Nightly builds, run with -Z macro-backtrace for more info)
help: you can convert an `i32` to an `i64`
  |
1 | #[membrane::sync_dart(namespace = "example")].into()
  |                                              +++++++