Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
Cython / tests / compile / const_T42.srctree
Size: Mime:
# tag: cpp
PYTHON setup.py build_ext --inplace
PYTHON -c "import test"

######## test.pyx ########
# distutils: language = c++

cdef extern from "test.h":
    ctypedef struct c_Test "Test":
        const char *getString() except +RuntimeError

cdef class Test:
    cdef c_Test *thisptr
    def getString(self):
        return self.thisptr.getString()

######## test.h ########

static const char *astring = "123";
class Test {
public:
    const char *getString(void) { return astring; }
};

######## setup.py ########

from distutils.core import setup
from Cython.Build.Dependencies import cythonize

setup(name='test', ext_modules=cythonize('*.pyx'))