Skip to content

Commit

Permalink
Update cbindgen config
Browse files Browse the repository at this point in the history
Change-Id: I8693c810fd024b106fc5d5114a1b43ac1b5f37fb
Signed-off-by: kexuan.yang <[email protected]>
  • Loading branch information
yangkx1024 committed Jan 29, 2024
1 parent 8781c32 commit 993e2b5
Show file tree
Hide file tree
Showing 11 changed files with 11 additions and 13 deletions.
Binary file modified android/library-encrypt/src/main/jniLibs/arm64-v8a/libmmkv.so
Binary file not shown.
Binary file modified android/library-encrypt/src/main/jniLibs/armeabi-v7a/libmmkv.so
Binary file not shown.
Binary file modified android/library-encrypt/src/main/jniLibs/x86_64/libmmkv.so
Binary file not shown.
Binary file modified android/library/src/main/jniLibs/arm64-v8a/libmmkv.so
Binary file not shown.
Binary file modified android/library/src/main/jniLibs/armeabi-v7a/libmmkv.so
Binary file not shown.
Binary file modified android/library/src/main/jniLibs/x86_64/libmmkv.so
Binary file not shown.
2 changes: 1 addition & 1 deletion build_apple.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ done
HEADER="include"
mkdir $HEADER
cargo expand ffi > $HEADER/mod.rs
cbindgen $HEADER/mod.rs -l C -s tag > src/ffi/rust_mmkv.h
cbindgen --config cbindgen.toml $HEADER/mod.rs -o src/ffi/rust_mmkv.h
cp src/ffi/rust_mmkv.h $HEADER/rust_mmkv.h
rm $HEADER/mod.rs
touch $HEADER/module.modulemap
Expand Down
5 changes: 5 additions & 0 deletions cbindgen.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
language = "C"
style = "tag"

[export]
include = ["RawTypedArray"]
Binary file modified ios/MMKV/RustMMKV.xcframework.zip
Binary file not shown.
5 changes: 0 additions & 5 deletions src/ffi/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,6 @@ pub struct RawTypedArray {
pub len: usize,
}

#[no_mangle]
pub extern "C" fn __use_typed_array(typed_array: RawTypedArray) {
error!(LOG_TAG, "{:?}", typed_array)
}

#[repr(C)]
#[derive(Debug)]
pub struct NativeLogger {
Expand Down
12 changes: 5 additions & 7 deletions src/ffi/rust_mmkv.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,6 @@ enum Types {
F64Array,
};

struct RawTypedArray {
const void *array;
enum Types type_token;
uintptr_t len;
};

struct ByteSlice {
const uint8_t *bytes;
uintptr_t len;
Expand Down Expand Up @@ -57,7 +51,11 @@ typedef const float *CF32Array;

typedef const double *CF64Array;

void __use_typed_array(struct RawTypedArray typed_array);
struct RawTypedArray {
const void *array;
enum Types type_token;
uintptr_t len;
};

void initialize(const char *dir);

Expand Down

0 comments on commit 993e2b5

Please sign in to comment.