Skip to content

Commit

Permalink
Use CInt when interfacing with C
Browse files Browse the repository at this point in the history
  • Loading branch information
unereal authored and lerno committed Mar 7, 2024
1 parent 028023b commit fe4f657
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/content/docs/references/docs/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,10 +162,10 @@ new temp allocator aware of the external temp allocator:

**Q:** How do I call a C function from C3?

**A:** Just copy the C function definition and prefix it with `external` (and don't forget the `fn` as well).
**A:** Just copy the C function definition and prefix it with `extern` (and don't forget the `fn` as well).

Imagine for example that you have the function `double test(int a, void* b)`. To call it from C3 just declare
`extern fn double test(int a, void* b)` in the C3 code.
`extern fn double test(CInt a, void* b)` in the C3 code.

**Q:** My C function / global has a name that doesn't conform to the C3 name requirements, just `extern fn` doesn't
work.
Expand Down

0 comments on commit fe4f657

Please sign in to comment.