We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents ae9b87f + 6e93a7c commit 8c57c4eCopy full SHA for 8c57c4e
src/ffi.md
@@ -662,13 +662,13 @@ fairly easy, but requires a few things:
662
663
```rust
664
#[no_mangle]
665
-pub extern fn hello_rust() -> *const u8 {
+pub extern "C" fn hello_rust() -> *const u8 {
666
"Hello, world!\0".as_ptr()
667
}
668
# fn main() {}
669
```
670
671
-The `extern` makes this function adhere to the C calling convention, as
+The `extern "C"` makes this function adhere to the C calling convention, as
672
discussed above in "[Foreign Calling
673
Conventions](ffi.html#foreign-calling-conventions)". The `no_mangle`
674
attribute turns off Rust's name mangling, so that it is easier to link to.
0 commit comments