Skip to content

Commit

Permalink
ffi: explicitly declare hello_from_rust for C99
Browse files Browse the repository at this point in the history
  • Loading branch information
mqy committed Feb 21, 2022
1 parent 90993ee commit edb350a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/ffi.md
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,10 @@ We'll create a C file to call the `hello_from_rust` function and compile it by `
C file should look like:

```c
// Explicitly declare to avoid error like this:
// implicit declaration of function 'hello_from_rust' is invalid in C99 ...
extern void hello_from_rust();

int main(void) {
hello_from_rust();
return 0;
Expand Down

0 comments on commit edb350a

Please sign in to comment.