From 222e0db40fe9d691865e80566b63e7aaa264e15b Mon Sep 17 00:00:00 2001 From: vsr Date: Mon, 13 Mar 2006 06:47:01 +0000 Subject: [PATCH] PAL11834 --- .../SALOME_PYQT_GUI/SALOME_PYQT_Module.cxx | 12 +++++++++--- src/SALOME_SWIG/SALOMEGUI_shared_modules.py | 3 +++ 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/SALOME_PYQT/SALOME_PYQT_GUI/SALOME_PYQT_Module.cxx b/src/SALOME_PYQT/SALOME_PYQT_GUI/SALOME_PYQT_Module.cxx index 1f1a3a5e2..0593d7784 100644 --- a/src/SALOME_PYQT/SALOME_PYQT_GUI/SALOME_PYQT_Module.cxx +++ b/src/SALOME_PYQT/SALOME_PYQT_GUI/SALOME_PYQT_Module.cxx @@ -120,10 +120,16 @@ private: // While the SalomePyQtGUI library is not imported in Python it's initialization function // should be called manually (and only once) in order to initialize global sip data // and to get C API from sip : sipBuildResult for example +#if defined(SIP_VERS_v4_old) || defined(SIP_VERS_v4_new) +#define INIT_FUNCTION initSalomePyQtGUI #if defined(SIP_STATIC_MODULE) -extern "C" void initSalomePyQtGUI(); +extern "C" void INIT_FUNCTION(); +#else +PyMODINIT_FUNC INIT_FUNCTION(); +#endif #else -PyMODINIT_FUNC initSalomePyQtGUI(); +#define INIT_FUNCTION initlibSalomePyQtGUIc +extern "C" void INIT_FUNCTION(); #endif /*! @@ -136,7 +142,7 @@ extern "C" { if ( !alreadyInitialized ) { // call only once (see above) ! PyEval_RestoreThread( KERNEL_PYTHON::_gtstate ); - initSalomePyQtGUI(); + INIT_FUNCTION(); PyEval_ReleaseThread( KERNEL_PYTHON::_gtstate ); alreadyInitialized = !alreadyInitialized; } diff --git a/src/SALOME_SWIG/SALOMEGUI_shared_modules.py b/src/SALOME_SWIG/SALOMEGUI_shared_modules.py index 086d5e7fe..cd849085d 100755 --- a/src/SALOME_SWIG/SALOMEGUI_shared_modules.py +++ b/src/SALOME_SWIG/SALOMEGUI_shared_modules.py @@ -4,6 +4,9 @@ import SALOME_Session_idl +from import_hook import register_name +register_name("SalomePyQt") + # this function is required def init_shared_modules(): -- 2.39.2