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