Update README.md

This commit is contained in:
Nicholas Maselli 2023-04-27 11:30:35 -04:00 committed by GitHub
parent 1a306d6d12
commit 09ef58a304
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -47,11 +47,13 @@ pub extern "C" fn my_add(x: i32, y: i32) -> i32 {
Setup csbindgen code to `build.rs`. Setup csbindgen code to `build.rs`.
```rust ```rust
csbindgen::Builder::default() fn main() {
.input_extern_file("lib.rs") csbindgen::Builder::default()
.csharp_dll_name("nativelib") .input_extern_file("lib.rs")
.generate_csharp_file("../dotnet/NativeMethods.g.cs") .csharp_dll_name("nativelib")
.unwrap(); .generate_csharp_file("../dotnet/NativeMethods.g.cs")
.unwrap();
}
``` ```
It will generate this C# code. It will generate this C# code.