-
-
Save tito/5899527 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# case 1 | |
if (some condition......): | |
some code........ | |
else: | |
# THIS WORKS # | |
# currently this only works for rangeOfString: method | |
f_type.size = 0 | |
f_type.alignment = 0 | |
f_type.type = FFI_TYPE_STRUCT | |
f_type.elements = elements | |
elements[0] = &ffi_type_uint64 | |
elements[1] = &ffi_type_uint64 | |
elements[2] = NULL | |
######################################################### | |
# case 2 | |
cdef void _resolve_complex_ffi_type(self): | |
cdef: | |
ffi_type *f_type | |
ffi_type **elements | |
f_type = <ffi_type*>malloc(sizeof(ffi_type)) | |
elements = <ffi_type**>malloc(sizeof(ffi_type*) * 3) | |
f_type.size = 0 | |
f_type.alignment = 0 | |
f_type.type = FFI_TYPE_STRUCT | |
f_type.elements = elements | |
elements[0] = &ffi_type_uint64 | |
elements[1] = &ffi_type_uint64 | |
elements[2] = NULL | |
self.f_result_type = f_type | |
. | |
. | |
. | |
. | |
if (some condition......): | |
some code........ | |
else: | |
# THIS DOES NOT WORK # | |
self._resolve_complex_ffi_type() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment