From 9e980643b26bf6e335ca0635c0bc54847ffd4567 Mon Sep 17 00:00:00 2001 From: Yoshifumi Kawai <46207+neuecc@users.noreply.github.com> Date: Tue, 7 Mar 2023 17:20:33 +0900 Subject: [PATCH] Update README.md --- README.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 0ba7f63..3a16279 100644 --- a/README.md +++ b/README.md @@ -80,8 +80,7 @@ cc::Build::new().file("lz4.c").compile("lz4"); // csbindgen code, generate both rust ffi and C# dll import csbindgen::Builder::default() .input_bindgen_file("lz4.rs") // read from bindgen generated code - .rust_file_header("use super::lz4;") // import bindgen struct - .rust_method_type_path("lz4") // invoke bindgen method + .rust_file_header("use super::lz4::*;") // import bindgen generated modules(struct/method) .csharp_entry_point_prefix("csbindgen_") // adjust same signature of rust method and C# EntryPoint .csharp_dll_name("liblz4") .generate_to_file("lz4_ffi.rs", "../dotnet/NativeMethods.lz4.g.cs") @@ -96,12 +95,12 @@ It will generates like these code. #[allow(unused)] use ::std::os::raw::*; -use super::lz4; +use super::lz4::*; #[no_mangle] pub unsafe extern "C" fn csbindgen_LZ4_compress_default(src: *const c_char, dst: *mut c_char, srcSize: c_int, dstCapacity: c_int) -> c_int { - lz4::LZ4_compress_default(src, dst, srcSize, dstCapacity) + LZ4_compress_default(src, dst, srcSize, dstCapacity) } ```