File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Expand file tree Collapse file tree 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
207207
208208## C function signature conversions
209209
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);` |
216216
217217Note: The Rust signatures should be wrapped in an `extern "ABI" { ... }` block.
218218
You can’t perform that action at this time.
0 commit comments