Skip to content

Commit 2e526ff

Browse files
committed
modffi: Support return values of mp_obj_t type.
1 parent 8064892 commit 2e526ff

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

unix/modffi.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ STATIC ffi_type *char2ffi_type(char c)
110110
case 'f': return &ffi_type_float;
111111
case 'd': return &ffi_type_double;
112112
#endif
113+
case 'O': // mp_obj_t
113114
case 'C': // (*)()
114115
case 'P': // const void*
115116
case 'p': // void*
@@ -153,6 +154,8 @@ STATIC mp_obj_t return_ffi_value(ffi_arg val, char type)
153154
return mp_obj_new_float(*p);
154155
}
155156
#endif
157+
case 'O':
158+
return (mp_obj_t)val;
156159
default:
157160
return mp_obj_new_int(val);
158161
}

0 commit comments

Comments
 (0)