X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FLifeCycleCORBA_SWIG%2FlibSALOME_LifeCycleCORBA.i;h=b931551a7bfa753f8d650110525b1896b84b26f5;hb=d8edd4804d9e6513a17c497c1a30326d4ba0d677;hp=59ccceaa67a99a13f55ed61e1e905844ceae60c9;hpb=b83f7739ffb0509786b791c57366a57a4cc7c3e2;p=modules%2Fkernel.git diff --git a/src/LifeCycleCORBA_SWIG/libSALOME_LifeCycleCORBA.i b/src/LifeCycleCORBA_SWIG/libSALOME_LifeCycleCORBA.i index 59ccceaa6..b931551a7 100644 --- a/src/LifeCycleCORBA_SWIG/libSALOME_LifeCycleCORBA.i +++ b/src/LifeCycleCORBA_SWIG/libSALOME_LifeCycleCORBA.i @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2021 CEA/DEN, EDF R&D, OPEN CASCADE // // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS @@ -6,7 +6,7 @@ // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2.1 of the License. +// version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -45,27 +45,9 @@ typedef int Py_ssize_t; #define PY_SSIZE_T_MIN INT_MIN #endif -//--- from omniORBpy.h (not present on Debian Sarge packages) - -struct omniORBpyAPI { - - PyObject* (*cxxObjRefToPyObjRef)(const CORBA::Object_ptr cxx_obj, - CORBA::Boolean hold_lock); - // Convert a C++ object reference to a Python object reference. - // If is true, caller holds the Python interpreter lock. - - CORBA::Object_ptr (*pyObjRefToCxxObjRef)(PyObject* py_obj, - CORBA::Boolean hold_lock); - // Convert a Python object reference to a C++ object reference. - // Raises BAD_PARAM if the Python object is not an object reference. - // If is true, caller holds the Python interpreter lock. - - - omniORBpyAPI(); - // Constructor for the singleton. Sets up the function pointers. -}; - -omniORBpyAPI* api; +#include +#include +omniORBpyAPI* api=0; %} @@ -81,10 +63,10 @@ omniORBpyAPI* api; if (!omnipy) { PyErr_SetString(PyExc_ImportError, (char*)"Cannot import _omnipy"); - return; + return NULL; } PyObject* pyapi = PyObject_GetAttrString(omnipy, (char*)"API"); - api = (omniORBpyAPI*)PyCObject_AsVoidPtr(pyapi); + api = (omniORBpyAPI*)PyCapsule_GetPointer(pyapi,"_omnipy.API"); Py_DECREF(pyapi); %} @@ -214,7 +196,7 @@ omniORBpyAPI* api; try { $action } - catch (ServiceUnreachable) { + catch (ServiceUnreachable&) { Py_BLOCK_THREADS PyErr_SetString(PyExc_RuntimeError,"Naming Service Unreacheable"); return NULL;