init
This commit is contained in:
commit
38355d2442
9083 changed files with 1225834 additions and 0 deletions
|
|
@ -0,0 +1,18 @@
|
|||
#include <Python.h>
|
||||
|
||||
PyMODINIT_FUNC
|
||||
PyInit_{modname}(void)
|
||||
{{
|
||||
PyObject *tmp;
|
||||
if (!(tmp = PyImport_ImportModule("{libname}"))) return NULL;
|
||||
Py_DECREF(tmp);
|
||||
void *init_func = PyCapsule_Import("{libname}.init_{full_modname}", 0);
|
||||
if (!init_func) {{
|
||||
return NULL;
|
||||
}}
|
||||
return ((PyObject *(*)(void))init_func)();
|
||||
}}
|
||||
|
||||
// distutils sometimes spuriously tells cl to export CPyInit___init__,
|
||||
// so provide that so it chills out
|
||||
PyMODINIT_FUNC PyInit___init__(void) {{ return PyInit_{modname}(); }}
|
||||
Loading…
Add table
Add a link
Reference in a new issue