You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sometimes, a C library wants to provide a pointer to something, but not let you know the internal details of the thing it wants.
708
+
A stable and simple way is to use a `void *` argument:
716
709
717
710
```c
718
711
voidfoo(void *arg);
@@ -781,3 +774,9 @@ Notice that it is a really bad idea to use an empty enum as FFI type.
781
774
The compiler relies on empty enums being uninhabited, so handling values of type
782
775
`&Empty` is a huge footgun and can lead to buggy program behavior (by triggering
783
776
undefined behavior).
777
+
778
+
> **NOTE:** The simplest way would use "extern types".
779
+
But it's currently (as of June 2021) unstable and has some unresolved questions, see the [RFC page][extern-type-rfc] and the [tracking issue][extern-type-issue] for more details.
0 commit comments