Skip to content

Commit

Permalink
Add some missing FFI safe types (fr)
Browse files Browse the repository at this point in the history
Translation of pull request ANSSI-FR#42
  • Loading branch information
polazarus committed Jun 30, 2020
1 parent b0a9ebf commit 7e3c1f1
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/fr/07_ffi.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,15 @@ Les types suivants sont considérés comme compatibles avec le C :
- les `enum`s annotées avec `repr(C)` ou `repr(Int)` (où `Int` est un type
primitif entier), contenant au moins un variant et dont tous les variants ne
comportent pas de champ ;
- les pointeurs.
- les pointeurs ;
- un `Option<T>` où `T` est:
- `core::ptr::NonNull<U>` et `U` est un type compatible avec le C et `Sized`,
auquel cas le type est équivalent à un pointeur `*const T` et `*mut T`,
- `core::num::NonZero*`, auquel cas le type est équivalent au type primitif
entier correspondant ;
- a `repr(transparent)`-annotated `struct` with only one field, where that
field has a C-compatible type.
Les types suivants ne sont pas compatibles avec le C :
Expand Down

0 comments on commit 7e3c1f1

Please sign in to comment.