From: rnv Date: Thu, 28 Jul 2022 08:32:09 +0000 (+0300) Subject: #30278 [CEA][Windows] PY2CPP compilation issue X-Git-Tag: V9_10_0a1~1 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=refs%2Fheads%2Frnv%2F30278_windows_compilation;p=tools%2Fpy2cpp.git #30278 [CEA][Windows] PY2CPP compilation issue --- diff --git a/src/Result.hxx b/src/Result.hxx index f2f9c6f..9a89a0e 100644 --- a/src/Result.hxx +++ b/src/Result.hxx @@ -28,7 +28,7 @@ namespace py2cpp { template -class PY2CPP_EXPORT Result; +class Result; /*! class Result is used by pyResult function for syntax sugar purpose. * You can write this: @@ -58,7 +58,7 @@ class PY2CPP_EXPORT Result; * std::cerr << py2cpp::getLastPyError(); **/ template<> -class PY2CPP_EXPORT Result<> +class Result<> { public: void operator=(PyObject * po) @@ -70,7 +70,7 @@ public: }; template -class PY2CPP_EXPORT Result +class Result { public: Result() = delete; @@ -92,7 +92,7 @@ private: }; template -class PY2CPP_EXPORT Result +class Result { public: Result() = delete; @@ -112,7 +112,7 @@ private: }; template -PY2CPP_EXPORT Result pyResult(Ts&... args) +Result pyResult(Ts&... args) { return Result(args...); } diff --git a/src/TypeConversions.hxx b/src/TypeConversions.hxx index 8575ce6..9f58844 100644 --- a/src/TypeConversions.hxx +++ b/src/TypeConversions.hxx @@ -110,7 +110,7 @@ addInPyTuple(PyObject * result, const std::tuple& vars ) } template -PY2CPP_EXPORT PyObject * toPy(const std::tuple& vars ) +PyObject * toPy(const std::tuple& vars ) { PyObject * result = PyTuple_New(sizeof...(Ts)); addInPyTuple<0, Ts... >(result, vars); @@ -119,7 +119,7 @@ PY2CPP_EXPORT PyObject * toPy(const std::tuple& vars ) // std containers template -PY2CPP_EXPORT PyObject * toPy(const std::vector& values) +PyObject * toPy(const std::vector& values) { PyObject * result = PyList_New(values.size()); for(std::size_t i = 0; i < values.size(); ++i) @@ -128,7 +128,7 @@ PY2CPP_EXPORT PyObject * toPy(const std::vector& values) } template -PY2CPP_EXPORT PyObject * toPy(const std::list& values) +PyObject * toPy(const std::list& values) { PyObject * result = PyList_New(values.size()); std::size_t i = 0; @@ -141,7 +141,7 @@ PY2CPP_EXPORT PyObject * toPy(const std::list& values) } template -PY2CPP_EXPORT PyObject * toPy(const std::map& values) +PyObject * toPy(const std::map& values) { PyObject * result = PyDict_New(); for(const auto& it: values) @@ -174,7 +174,7 @@ getFromPyTuple(PyObject * tup, std::tuple& vars ) } template -PY2CPP_EXPORT ConversionCheck fromPy(PyObject * obj, std::tuple& vars) +ConversionCheck fromPy(PyObject * obj, std::tuple& vars) { ConversionCheck check; if(obj) @@ -198,7 +198,7 @@ PY2CPP_EXPORT ConversionCheck fromPy(PyObject * obj, std::tuple& vars) } template -PY2CPP_EXPORT ConversionCheck fromPy( PyObject *obj, std::vector& result) +ConversionCheck fromPy( PyObject *obj, std::vector& result) { ConversionCheck check; if(PyList_Check(obj)) @@ -227,7 +227,7 @@ PY2CPP_EXPORT ConversionCheck fromPy( PyObject *obj, std::vector& result) } template -PY2CPP_EXPORT ConversionCheck fromPy( PyObject *obj, std::list& result) +ConversionCheck fromPy( PyObject *obj, std::list& result) { ConversionCheck check; if(PyList_Check(obj)) @@ -270,7 +270,7 @@ PY2CPP_EXPORT ConversionCheck fromPy( PyObject *obj, std::list& result) } template -PY2CPP_EXPORT ConversionCheck fromPy( PyObject *obj, std::map& result) +ConversionCheck fromPy( PyObject *obj, std::map& result) { ConversionCheck check; if(PyDict_Check(obj)) @@ -299,7 +299,7 @@ PY2CPP_EXPORT ConversionCheck fromPy( PyObject *obj, std::map& result) // PyPtr template -PY2CPP_EXPORT T fromPyPtr( const PyPtr& py) +T fromPyPtr( const PyPtr& py) { T result; fromPy(py.get(), result); @@ -307,19 +307,19 @@ PY2CPP_EXPORT T fromPyPtr( const PyPtr& py) } template -PY2CPP_EXPORT ConversionCheck fromPyPtr( const PyPtr& py, T& var) +ConversionCheck fromPyPtr( const PyPtr& py, T& var) { return fromPy(py.get(), var); } template -PY2CPP_EXPORT PY2CPP_EXPORT PyPtr toPyPtr(const T& v) +PyPtr toPyPtr(const T& v) { return PyPtr(toPy(v)); } template -PY2CPP_EXPORT T fromPy( PyObject *po) +T fromPy( PyObject *po) { T result; ConversionCheck check;