diff options
Diffstat (limited to 'ffi.c')
-rw-r--r-- | ffi.c | 15 |
1 files changed, 14 insertions, 1 deletions
@@ -736,11 +736,24 @@ static val ffi_ptr_in_in(struct txr_ffi_type *tft, int copy, mem_t *src, val tgttype = tft->mtypes; struct txr_ffi_type *tgtft = ffi_type_struct(tgttype); mem_t **loc = coerce(mem_t **, src); + if (tgtft->in != 0) + tgtft->in(tgtft, 0, *loc, obj, self); tgtft->free(*loc); *loc = 0; return obj; } +static val ffi_ptr_in_d_in(struct txr_ffi_type *tft, int copy, mem_t *src, + val obj, val self) +{ + val tgttype = tft->mtypes; + struct txr_ffi_type *tgtft = ffi_type_struct(tgttype); + mem_t **loc = coerce(mem_t **, src); + if (tgtft->in != 0) + tgtft->in(tgtft, 0, *loc, obj, self); + return obj; +} + static void ffi_ptr_in_out(struct txr_ffi_type *tft, int copy, val s, mem_t *dst, val self) { @@ -1394,7 +1407,7 @@ val ffi_type_compile(val syntax) val target_type = ffi_type_compile(cadr(syntax)); return make_ffi_type_pointer(syntax, cptr_s, sizeof (mem_t *), ffi_ptr_in_put, ffi_ptr_d_get, - 0, ffi_ptr_in_out, + ffi_ptr_in_d_in, ffi_ptr_in_out, target_type); } else if (sym == ptr_out_s) { val target_type = ffi_type_compile(cadr(syntax)); |