Skip to content

Commit d926ddc

Browse files
soulee-devaduh95
authored andcommitted
doc: add missing float32/float64 FFI type names
`ToFFIType()` accepts `float32` and `float64` as aliases for `float` and `double`, and both names already appear in the `ffi.types` constants list further down the same page, but they were missing from the list of supported type names. Also split `char` onto its own line. Unlike `u8`, `uint8` and `bool`, which always map to `ffi_type_uint8`, `char` maps to either `ffi_type_sint8` or `ffi_type_uint8` depending on the platform C ABI, as the paragraph below the list already explains. Signed-off-by: Soul Lee <alus20x@gmail.com> PR-URL: #64874 Refs: #62892 Refs: #64848 Reviewed-By: René <contact.9a5d6388@renegade334.me.uk> Reviewed-By: Paolo Insogna <paolo@cowtech.it> Reviewed-By: Ulises Gascón <ulisesgascongonzalez@gmail.com>
1 parent 5e433fd commit d926ddc

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

doc/api/ffi.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,16 +62,17 @@ FFI signatures use string type names.
6262
Supported type names:
6363

6464
* `void`
65+
* `char`
6566
* `i8`, `int8`
66-
* `u8`, `uint8`, `bool`, `char`
67+
* `u8`, `uint8`, `bool`
6768
* `i16`, `int16`
6869
* `u16`, `uint16`
6970
* `i32`, `int32`
7071
* `u32`, `uint32`
7172
* `i64`, `int64`
7273
* `u64`, `uint64`
73-
* `f32`, `float`
74-
* `f64`, `double`
74+
* `f32`, `float`, `float32`
75+
* `f64`, `double`, `float64`
7576
* `pointer`, `ptr`
7677
* `string`, `str`
7778
* `buffer`

0 commit comments

Comments
 (0)