diff --git a/Cargo.toml b/Cargo.toml index 1fa4d60..9f86e81 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -74,14 +74,14 @@ hmac = { version = "0.12.1", optional = true } ed25519-bip32 = { version = "0.4.1", optional = true } ledger-transport-hid = { version = "0.9", optional = true } -allo-isolate = { version = "0.1" } -once_cell = { version = "1.8.0" } -android_logger = { version = "0.10.0" } +allo-isolate = { version = "0.1", optional = true } +once_cell = { version = "1.8.0", optional = true } +android_logger = { version = "0.10.0", optional = true } [features] ledger = ["ledger-apdu", "hmac", "ed25519-bip32", "ledger-transport-hid"] ledger_sapling = ["ledger"] -# dart_ffi = ["allo-isolate", "once_cell", "android_logger"] +dart_ffi = ["allo-isolate", "once_cell", "android_logger"] # librustzcash synced to 35023ed8ca2fb1061e78fd740b640d4eefcc5edd diff --git a/binding.h b/binding.h index f7d9473..b7152e2 100644 --- a/binding.h +++ b/binding.h @@ -1,7 +1,17 @@ -#include -#include -#include -#include +#ifndef __APPLE__ +typedef char int8_t; +typedef unsigned char uint8_t; +typedef short int uint16_t; +typedef long long int int64_t; +typedef long long int uint64_t; +typedef long long int uintptr_t; +typedef long int int32_t; +typedef long int uint32_t; +typedef char bool; +#endif +typedef void *DartPostCObjectFnType; + +void dummy_export(void); void dart_post_cobject(DartPostCObjectFnType ptr); diff --git a/binding2.h b/binding2.h new file mode 100644 index 0000000..51d8733 --- /dev/null +++ b/binding2.h @@ -0,0 +1,12 @@ +#ifndef __APPLE__ +typedef char int8_t; +typedef unsigned char uint8_t; +typedef short int uint16_t; +typedef long long int int64_t; +typedef long long int uint64_t; +typedef long long int uintptr_t; +typedef long int int32_t; +typedef long int uint32_t; +typedef char bool; +#endif +typedef void *DartPostCObjectFnType; diff --git a/build.rs b/build.rs index b7e2ca8..32bab8c 100644 --- a/build.rs +++ b/build.rs @@ -7,7 +7,7 @@ fn main() { ) .unwrap(); - create_c_bindings(); + // create_c_bindings(); } #[allow(dead_code)] diff --git a/src/api/dart_ffi.rs b/src/api/dart_ffi.rs index 67709f8..c5cb49f 100644 --- a/src/api/dart_ffi.rs +++ b/src/api/dart_ffi.rs @@ -13,6 +13,9 @@ use zcash_primitives::transaction::builder::Progress; static mut POST_COBJ: Option = None; +#[no_mangle] +pub unsafe extern "C" fn dummy_export() {} + #[no_mangle] pub unsafe extern "C" fn dart_post_cobject(ptr: ffi::DartPostCObjectFnType) { POST_COBJ = Some(ptr);