From 56018af98a5afb5dca2952aecefb538e1e77a694 Mon Sep 17 00:00:00 2001 From: abn Date: Mon, 10 May 2021 13:54:01 +0200 Subject: [PATCH] [ICoCo] renamed header and symbol for decl spec + shell script to test equality between GitHub and MC version --- src/ICoCo/ICoCoField.hxx | 4 +-- src/ICoCo/ICoCoMEDDoubleField.hxx | 3 +- src/ICoCo/ICoCoMEDIntField.hxx | 2 +- src/ICoCo/{ICoCo.hxx => ICoCo_DeclSpec.hxx} | 10 +++---- src/ICoCo/Swig/ICoCoMEDField.i | 2 ++ src/ICoCo/github/check_consistency.sh | 31 +++++++++++++++++++++ src/ParaMEDMEM_Swig/ParaMEDMEM.i | 1 - src/PyWrapping/medcoupling.i | 1 - 8 files changed, 42 insertions(+), 12 deletions(-) rename src/ICoCo/{ICoCo.hxx => ICoCo_DeclSpec.hxx} (85%) create mode 100755 src/ICoCo/github/check_consistency.sh diff --git a/src/ICoCo/ICoCoField.hxx b/src/ICoCo/ICoCoField.hxx index ea4959e2e..5f66d1984 100644 --- a/src/ICoCo/ICoCoField.hxx +++ b/src/ICoCo/ICoCoField.hxx @@ -26,7 +26,7 @@ #define ICoCoField_included #include -#include "ICoCo.hxx" +#include namespace ICoCo { @@ -34,7 +34,7 @@ namespace ICoCo * * The Field class holds the name of the field. */ - class MEDCOUPLINGICOCO_EXPORT Field + class ICOCO_EXPORT Field { public: /*! @brief Set the name of the field. diff --git a/src/ICoCo/ICoCoMEDDoubleField.hxx b/src/ICoCo/ICoCoMEDDoubleField.hxx index ef68ea9a0..dcaa36524 100644 --- a/src/ICoCo/ICoCoMEDDoubleField.hxx +++ b/src/ICoCo/ICoCoMEDDoubleField.hxx @@ -26,7 +26,6 @@ #define ICoCoMEDDoubleField_included #include "ICoCoField.hxx" -#include "ICoCo.hxx" namespace MEDCoupling { @@ -45,7 +44,7 @@ namespace ICoCo * @sa the MEDCoupling documentation, notably the reference counter mechanism used to manage the lifecycle of * MEDCoupling objects. */ - class MEDCOUPLINGICOCO_EXPORT MEDDoubleField : public ICoCo::Field + class ICOCO_EXPORT MEDDoubleField : public ICoCo::Field { public: /*! Builds an empty field (internal MEDCoupling object not set). diff --git a/src/ICoCo/ICoCoMEDIntField.hxx b/src/ICoCo/ICoCoMEDIntField.hxx index 1adfbc859..31c7454b9 100644 --- a/src/ICoCo/ICoCoMEDIntField.hxx +++ b/src/ICoCo/ICoCoMEDIntField.hxx @@ -44,7 +44,7 @@ namespace ICoCo * @sa the MEDCoupling documentation, notably the reference counter mechanism used to manage the lifecycle of * MEDCoupling objects. */ - class MEDCOUPLINGICOCO_EXPORT MEDIntField : public ICoCo::Field + class ICOCO_EXPORT MEDIntField : public ICoCo::Field { public: /*! Builds an empty field (internal MEDCoupling object not set). diff --git a/src/ICoCo/ICoCo.hxx b/src/ICoCo/ICoCo_DeclSpec.hxx similarity index 85% rename from src/ICoCo/ICoCo.hxx rename to src/ICoCo/ICoCo_DeclSpec.hxx index e523f70b0..648130b64 100644 --- a/src/ICoCo/ICoCo.hxx +++ b/src/ICoCo/ICoCo_DeclSpec.hxx @@ -22,16 +22,16 @@ // // https://github.com/cea-trust-platform/icoco-coupling -#ifndef ICoCo_included +#ifndef ICoCo_DeclSpec_included #ifdef WIN32 # if defined medicoco_EXPORTS -# define MEDCOUPLINGICOCO_EXPORT __declspec( dllexport ) +# define ICOCO_EXPORT __declspec( dllexport ) # else -# define MEDCOUPLINGICOCO_EXPORT __declspec( dllimport ) +# define ICOCO_EXPORT __declspec( dllimport ) # endif #else -# define MEDCOUPLINGICOCO_EXPORT +# define ICOCO_EXPORT #endif -#endif // ICoCo_included +#endif // ICoCo_DeclSpec_included diff --git a/src/ICoCo/Swig/ICoCoMEDField.i b/src/ICoCo/Swig/ICoCoMEDField.i index f12c210d8..9f992ac35 100644 --- a/src/ICoCo/Swig/ICoCoMEDField.i +++ b/src/ICoCo/Swig/ICoCoMEDField.i @@ -23,6 +23,8 @@ #include "ICoCoMEDIntField.hxx" %} +#define ICOCO_EXPORT + %include "std_string.i" %include "ICoCoField.hxx" diff --git a/src/ICoCo/github/check_consistency.sh b/src/ICoCo/github/check_consistency.sh new file mode 100755 index 000000000..c59374507 --- /dev/null +++ b/src/ICoCo/github/check_consistency.sh @@ -0,0 +1,31 @@ +#!/bin/bash + +# +# Check that the ICoCo headers used in MEDCoupling are well synchronized with the official ICoCo version +# hosted at: +# https://github.com/cea-trust-platform/icoco-coupling +# + +rm -rf icoco-coupling +rm -rf tmp_compare + +git clone https://github.com/cea-trust-platform/icoco-coupling.git + +lst="ICoCo_DeclSpec.hxx ICoCoField.h ICoCoField.hxx ICoCoMEDDoubleField.h ICoCoMEDDoubleField.hxx ICoCoMEDIntField.h ICoCoMEDIntField.hxx" + +mkdir tmp_compare +cd tmp_compare +for f in $lst; do + tail -n+4 ../icoco-coupling/include/$f > "${f}_github" + tail -n+20 ../../$f > "${f}_mc" + diff "${f}_github" "${f}_mc" + if [ ! $? -eq 0 ]; then + echo "File $f is not the same in MEDCoupling repository and in official ICoCo GitHub repository!!" + exit 1 + fi +done + +cd .. +rm -rf icoco-coupling +rm -rf tmp_compare + diff --git a/src/ParaMEDMEM_Swig/ParaMEDMEM.i b/src/ParaMEDMEM_Swig/ParaMEDMEM.i index 5aee5c600..40d0bd8db 100644 --- a/src/ParaMEDMEM_Swig/ParaMEDMEM.i +++ b/src/ParaMEDMEM_Swig/ParaMEDMEM.i @@ -23,7 +23,6 @@ #define MEDCOUPLING_EXPORT #define INTERPKERNEL_EXPORT -#define MEDCOUPLINGICOCO_EXPORT %include "MEDCouplingCommon.i" %include "ICoCoMEDField.i" diff --git a/src/PyWrapping/medcoupling.i b/src/PyWrapping/medcoupling.i index 7fe41863a..3c7a0e6d1 100644 --- a/src/PyWrapping/medcoupling.i +++ b/src/PyWrapping/medcoupling.i @@ -25,7 +25,6 @@ #define INTERPKERNEL_EXPORT #define MEDCOUPLING_EXPORT #define MEDLOADER_EXPORT -#define MEDCOUPLINGICOCO_EXPORT %include "MEDCouplingCommon.i" -- 2.39.2