Changeset d5aeaa3 in sasview for src/sas/sascalc
- Timestamp:
- Sep 26, 2017 12:36:53 PM (7 years ago)
- Branches:
- master, ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc, magnetic_scatt, release-4.2.2, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
- Children:
- 0225a3f
- Parents:
- f542866
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/sascalc/file_converter/c_ext/bsl_loader.c
rd04ac05 rd5aeaa3 279 279 }; 280 280 281 static PyMethodDef module_methods[] = {282 {NULL}283 };284 285 281 /** 286 282 * Function used to add the model class to a module 287 283 * @param module: module to add the class to 288 284 */ 289 void addCLoader(PyObject *module) { 285 void addCLoader(PyObject *module) 286 { 290 287 if (PyType_Ready(&CLoaderType) < 0) 291 288 return; 292 293 289 Py_INCREF(&CLoaderType); 294 PyModule_AddObject(module, "bsl_loader", (PyObject *)&CLoaderType); 295 } 296 290 PyModule_AddObject(module, "CLoader", (PyObject *)&CLoaderType); 291 } 297 292 298 293 #define MODULE_DOC "C module for loading bsl." … … 312 307 313 308 #if PY_MAJOR_VERSION >= 3 309 310 static PyMethodDef module_methods[] = { 311 {NULL} 312 }; 314 313 315 314 DLL_EXPORT PyMODINIT_FUNC MODULE_INIT3(void) … … 326 325 NULL, /* m_free */ 327 326 }; 328 PyObject* m = PyModule_Create(&moduledef); 329 addCLoader(m); 330 return m; 327 PyObject* m = PyModule_Create(&moduledef); 328 import_array(); 329 addCLoader(m); 330 return m; 331 331 } 332 332 … … 335 335 DLL_EXPORT PyMODINIT_FUNC MODULE_INIT2(void) 336 336 { 337 PyObject* m = Py_InitModule4(MODULE_NAME, 338 MODULE_METHODS, 339 MODULE_DOC, 340 0, 341 PYTHON_API_VERSION 342 ); 343 addCLoader(m); 337 PyObject* m = Py_InitModule(MODULE_NAME, NULL); 338 import_array(); 339 addCLoader(m); 344 340 } 345 341
Note: See TracChangeset
for help on using the changeset viewer.