+ handle usage of libmedc < 3.0.7

This commit is contained in:
wmayer 2016-07-14 21:35:13 +02:00
parent ff060d4f1f
commit f1d59002be

View File

@ -33,6 +33,7 @@ static int MYDEBUG = 0;
// static int MYDEBUG = 0;
#endif
#define MED_VERSION_HEX (MED_NUM_MAJEUR << 16 | MED_NUM_MINEUR << 8 | MED_NUM_RELEASE)
namespace MED
@ -969,10 +970,14 @@ namespace MED
TInt aNbElem = (TInt)theInfo.myElemNum->size();
TErr aRet;
#if MED_VERSION_HEX < 0x030007
aRet = -1;
#else
aRet = MEDmeshPolygon2Rd(myFile->Id(), &aMeshName,
MED_NO_DT, MED_NO_IT,
anEntity, aGeom,
aConnMode, &anIndex, &aConn);
#endif
if(theErr)
*theErr = aRet;
@ -1027,11 +1032,15 @@ namespace MED
TValueHolder<EGeometrieElement, med_geometry_type> aGeom (anInfo.myGeom);
TValueHolder<EConnectivite, med_connectivity_mode> aConnMode(anInfo.myConnMode);
#if MED_VERSION_HEX < 0x030007
TErr aRet = -1;
#else
TErr aRet = MEDmeshPolygon2Wr(myFile->Id(), &aMeshName,
MED_NO_DT, MED_NO_IT, MED_UNDEF_DT,
anEntity, aGeom,
aConnMode, anInfo.myNbElem + 1,
&anIndex, &aConn);
#endif
if(theErr)
*theErr = aRet;
else if(aRet < 0)