Skip to content
Snippets Groups Projects
Commit ebd3d8d0 authored by André Anjos's avatar André Anjos :speech_balloon:
Browse files

Register the C-API on the module

parent fa2154f0
No related branches found
No related tags found
No related merge requests found
......@@ -119,6 +119,21 @@ PyMODINIT_FUNC XBOB_EXT_ENTRY_NAME (void) {
PyXbobIo_API[PyBobIoHDF5File_Converter_NUM] = (void *)&PyBobIoHDF5File_Converter;
#if PY_VERSION_HEX >= 0x02070000
/* defines the PyCapsule */
PyObject* c_api_object = PyCapsule_New((void *)PyXbobIo_API,
XBOB_EXT_MODULE_PREFIX "." XBOB_EXT_MODULE_NAME "._C_API", 0);
#else
PyObject* c_api_object = PyCObject_FromVoidPtr((void *)PyXbobIo_API, 0);
#endif
if (c_api_object) PyModule_AddObject(m, "_C_API", c_api_object);
/* imports the NumPy C-API */
import_array();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment