vtkpythonmodules.h
Go to the documentation of this file.
1 #ifndef vtkpythonmodules_h
2 #define vtkpythonmodules_h
3 #if PY_VERSION_HEX < 0x03000000
4 #define PY_APPEND_INIT(module) PyImport_AppendInittab("." #module, init ## module)
5 #define PY_IMPORT(module) init ## module();
6 #else
7 #define PY_APPEND_INIT(module) PyImport_AppendInittab("." #module, PyInit_ ## module)
8 #define PY_IMPORT(module) { \
9  PyObject* var_ ## module = PyInit_ ## module(); \
10  PyDict_SetItemString(PyImport_GetModuleDict(), "." #module,var_ ## module); \
11  Py_DECREF(var_ ## module); }
12 #endif
13 
14 #define PY_APPEND_INIT_OR_IMPORT(module, do_import) \
15  if (do_import) { PY_IMPORT(module); } else { PY_APPEND_INIT(module); }
16 
17 static void vtkpythonmodules_load() {
18 }
19 #undef PY_APPEND_INIT
20 #undef PY_IMPORT
21 #undef PY_APPEND_INIT_OR_IMPORT
22 #endif
static void vtkpythonmodules_load()