File tree 1 file changed +6
-6
lines changed
1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -207,12 +207,12 @@ let _ = close(Door::<Closed>("front".to_owned())); // error: mismatched types: e
207
207
208
208
## C function signature conversions
209
209
210
- Description C signature Equivalent Rust signature
211
- ---------------------- ---------------------------------------------- ------------------------------------------
212
- no parameters `void foo(void);` `fn foo();`
213
- return value `int foo(void);` `fn foo() -> c_int;`
214
- function parameters `void foo(int x, int y);` `fn foo(x: c_int, y: c_int);`
215
- in-out pointers `void foo(const int* in_ptr, int* out_ptr);` `fn foo(in_ptr: *c_int, out_ptr: *mut c_int);`
210
+ | Description | C signature | Equivalent Rust signature |
211
+ | ---------------------|- ----------------------------------------------| ------------------------------------------------|
212
+ | no parameters | `void foo(void);` | `fn foo();` |
213
+ | return value | `int foo(void);` | `fn foo() -> c_int;` |
214
+ | function parameters | `void foo(int x, int y);` | `fn foo(x: c_int, y: c_int);` |
215
+ | in-out pointers | `void foo(const int* in_ptr, int* out_ptr);` | `fn foo(in_ptr: *c_int, out_ptr: *mut c_int);` |
216
216
217
217
Note: The Rust signatures should be wrapped in an `extern "ABI" { ... }` block.
218
218
You can’t perform that action at this time.
0 commit comments