瀏覽代碼

It works!

Andy Dill 5 年之前
父節點
當前提交
f7f33d7d06
共有 4 個文件被更改,包括 5 次插入1 次删除
  1. 2 0
      librusty/.cargo/config
  2. 1 1
      librusty/rust-toolchain
  3. 2 0
      librusty/src/lib.rs
  4. 二進制
      unity/Assets/Plugins/iOS/librusty.a

+ 2 - 0
librusty/.cargo/config

@@ -0,0 +1,2 @@
1
+[build]
2
+rustflags = ["-C", "lto", "-Z", "embed-bitcode"]

+ 1 - 1
librusty/rust-toolchain

@@ -1 +1 @@
1
-nightly-2019-09-13
1
+nightly-2019-07-17

+ 2 - 0
librusty/src/lib.rs

@@ -2,6 +2,7 @@ use std::ffi::CStr;
2 2
 use std::ffi::CString;
3 3
 use std::os::raw::c_char;
4 4
 
5
+#[no_mangle]
5 6
 #[allow(non_snake_case)]
6 7
 pub extern "C" fn DoSomeInterestingWork(count: i32, content: *const c_char) -> *const c_char {
7 8
     let content_string = unsafe { CStr::from_ptr(content) }
@@ -22,6 +23,7 @@ pub extern "C" fn DoSomeInterestingWork(count: i32, content: *const c_char) -> *
22 23
         .into_raw()
23 24
 }
24 25
 
26
+#[no_mangle]
25 27
 #[allow(non_snake_case)]
26 28
 pub extern "C" fn FreeString(content: *mut c_char) {
27 29
     unsafe {

二進制
unity/Assets/Plugins/iOS/librusty.a