Rework interop callbacks

*   Do not rely on type inference and `CFunctionType`;
*   Represent struct-typed parameters and return values as `CValue<*>`
    (currently supported only on JVM).
This commit is contained in:
Svyatoslav Scherbina
2017-04-20 12:31:53 +03:00
committed by SvyatoslavScherbina
parent cc73c7e009
commit 3f84ba462f
12 changed files with 2532 additions and 1733 deletions
+1 -8
View File
@@ -275,14 +275,7 @@ methods available:
### Callbacks ###
To convert Kotlin function to pointer to C function,
`staticCFunction(::kotlinFunction)` can be used. Currently `staticCFunction`
heavily relies on type inference, so the expression `staticCFunction(...)`
should be either assigned to the variable having proper type explicitly
specified, or passed to the function, e.g.
```
glutDisplayFunc(staticCFunction(::display))
```
`staticCFunction(::kotlinFunction)` can be used.
Note that some function types are not supported currently. For example,
it is not possible to get pointer to function that receives or returns structs