Skip to content

Commit

Permalink
Use @export rather than @extern
Browse files Browse the repository at this point in the history
  • Loading branch information
lerno committed Nov 1, 2024
1 parent 5d1fc34 commit ddf1da6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/content/docs/Language Common/cinterop.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,16 @@ fn void main()
```

While C3 functions are available from C using their external name, it's often useful to
define an external name using `@extern` to match C usage.
define an external name using `@extern` or `@export` with a name to match C usage.

```c3
module foo;
fn int square(int x)
fn int square(int x) @export // @export ensures external visibility
{
return x * x;
}
fn int square2(int x) @extern("square")
fn int square2(int x) @export("square")
{
return x * x;
}
Expand Down

0 comments on commit ddf1da6

Please sign in to comment.