1
PYTHON setup.py build_ext --inplace
3
# Rebuild it with a flag to pretend we're on a platform where sizeof(function_ptr) != sizeof(void*)
4
PYTHON setup_large_func_pointers.py build_ext --inplace --force
7
######## setup.py ########
10
from Cython.Build import cythonize
11
from distutils.core import setup
14
ext_modules = cythonize("*.pyx"),
17
######## setup_large_func_pointers.py ########
20
from Cython.Build import cythonize
21
from distutils.core import setup, Extension
24
ext_modules = cythonize(Extension("*", ["*.pyx"],
25
extra_compile_args=["-D__Pyx_TEST_large_func_pointers=1"])),
28
######## other.pxd ########
35
######## other.pyx ########
43
######## pkg/__init__.py ########
46
######## pkg/sub.pxd ########
50
######## pkg/subpkg/__init__.py ########
52
######## pkg/subpkg/submod.pxd ########
56
######## a.pyx ########
66
cdef call_fooptr(int (*fptr)(int)):
70
x = other.foo # GH4000 - failed because other was untyped
71
return call_fooptr(x) # check that x is correctly resolved as a function pointer
73
print(other.A, other.foo(10), call_other_foo())
76
cdef sub.my_int a = 100
78
from pkg.subpkg cimport submod