Skip to content

Commit

Permalink
Fix typo
Browse files Browse the repository at this point in the history
  • Loading branch information
greenfork committed Dec 29, 2023
1 parent ad98266 commit 167f141
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/c-ffi/calling-c.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ In Pony, a String is an object with a header and fields, while in C a `char*` is

Pony classes and structs correspond directly to pointers to the class or struct in C.

For C pointers to simple types, such as U64, the Pony `Pointer[]` polymorphic type should be used, with a `tag` reference capability. To represent `void*` arguments, you should the `Pointer[None] tag` type, which will allow you to pass a pointer to any type, including other pointers. This is needed to write declarations for certain POSIX functions, such as `memcpy`:
For C pointers to simple types, such as U64, the Pony `Pointer[]` polymorphic type should be used, with a `tag` reference capability. To represent `void*` arguments, you should use the `Pointer[None] tag` type, which will allow you to pass a pointer to any type, including other pointers. This is needed to write declarations for certain POSIX functions, such as `memcpy`:

```pony
// The C type is void* memcpy(void *restrict dst, const void *restrict src, size_t n);
Expand Down

0 comments on commit 167f141

Please sign in to comment.