From d4a6018335902a05899afed3404dfddd704867de Mon Sep 17 00:00:00 2001 From: Anthony Geay Date: Tue, 14 Jan 2020 07:52:14 +0100 Subject: [PATCH] try to reduce ifdef for WIN porting --- .../MEDCouplingDataArrayTraits.hxx | 14 +++----------- .../MEDCouplingDataArrayTypemaps.i | 6 +----- 2 files changed, 4 insertions(+), 16 deletions(-) diff --git a/src/MEDCoupling_Swig/MEDCouplingDataArrayTraits.hxx b/src/MEDCoupling_Swig/MEDCouplingDataArrayTraits.hxx index dc07ddd68..e219ff929 100644 --- a/src/MEDCoupling_Swig/MEDCouplingDataArrayTraits.hxx +++ b/src/MEDCoupling_Swig/MEDCouplingDataArrayTraits.hxx @@ -147,12 +147,8 @@ extern "C" static PyObject *callbackmcdataarrayint64_call(PyCallBackDataArrayInt64 *self, PyObject *args, PyObject *kw) { if(self->_pt_mc) - { -#ifdef WIN32 - MEDCoupling::MemArray& mma=self->_pt_mc->accessToMemArray(); -#else - MEDCoupling::MemArray& mma=self->_pt_mc->accessToMemArray(); -#endif + { + MEDCoupling::MemArray& mma=self->_pt_mc->accessToMemArray(); mma.destroy(); } Py_XINCREF(Py_None); @@ -429,11 +425,7 @@ struct NPYTraits }; template<> -#ifdef WIN32 -struct NPYTraits -#else -struct NPYTraits -#endif +struct NPYTraits { static const int NPYObjectType=NPY_INT64; static PyTypeObject *NPYFunc; diff --git a/src/MEDCoupling_Swig/MEDCouplingDataArrayTypemaps.i b/src/MEDCoupling_Swig/MEDCouplingDataArrayTypemaps.i index 5c21279f6..31ff419ea 100644 --- a/src/MEDCoupling_Swig/MEDCouplingDataArrayTypemaps.i +++ b/src/MEDCoupling_Swig/MEDCouplingDataArrayTypemaps.i @@ -3363,11 +3363,7 @@ PyTypeObject *NPYTraits::NPYFunc=&PyCallBackDataArrayFloat_RefType; PyTypeObject *NPYTraits::NPYFunc=&PyCallBackDataArrayInt32_RefType; -#ifdef WIN32 -PyTypeObject *NPYTraits::NPYFunc=&PyCallBackDataArrayInt64_RefType; -#else -PyTypeObject *NPYTraits::NPYFunc=&PyCallBackDataArrayInt64_RefType; -#endif +PyTypeObject *NPYTraits::NPYFunc=&PyCallBackDataArrayInt64_RefType; #endif template -- 2.39.2