From: ana Date: Fri, 18 Dec 2015 09:12:38 +0000 (+0300) Subject: Windows compatibility X-Git-Tag: V8_0_0a1^2 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=aa702382d781b69b0e45feb8007789523c04f35b;p=tools%2Fmedcoupling.git Windows compatibility --- diff --git a/src/INTERP_KERNELTest/TestInterpKernelUtils.cxx b/src/INTERP_KERNELTest/TestInterpKernelUtils.cxx index 262699a35..5adeb43fc 100644 --- a/src/INTERP_KERNELTest/TestInterpKernelUtils.cxx +++ b/src/INTERP_KERNELTest/TestInterpKernelUtils.cxx @@ -21,7 +21,12 @@ #include "InterpKernelException.hxx" #include +#ifdef WIN32 +#include +#define getcwd _getcwd +#else #include +#endif #include #include @@ -43,7 +48,7 @@ namespace INTERP_TEST } if (!good) { - resourceFile = get_current_dir_name(); + resourceFile = getcwd(NULL, 0); resourceFile += "/../../resources/"; std::ifstream my_file(resourceFile); if (!my_file.good()) diff --git a/src/MEDLoader/Test/MEDLoaderTest.cxx b/src/MEDLoader/Test/MEDLoaderTest.cxx index 84a59d8ba..63c330188 100644 --- a/src/MEDLoader/Test/MEDLoaderTest.cxx +++ b/src/MEDLoader/Test/MEDLoaderTest.cxx @@ -27,8 +27,12 @@ #include #include -#include // get_current_dir_name() - +#ifdef WIN32 +#include +#define getcwd _getcwd +#else +#include +#endif using namespace ParaMEDMEM; void MEDLoaderTest::testMesh1DRW() @@ -1157,7 +1161,7 @@ std::string MEDLoaderTest::getResourceFile( const std::string& filename ) const resourceFile += "/share/resources/med/"; } else { - resourceFile = get_current_dir_name(); + resourceFile = getcwd(NULL, 0); resourceFile += "/../../../resources/"; } diff --git a/src/MEDLoader/Test/SauvLoaderTest.cxx b/src/MEDLoader/Test/SauvLoaderTest.cxx index 6ac13e4fe..1674cffec 100644 --- a/src/MEDLoader/Test/SauvLoaderTest.cxx +++ b/src/MEDLoader/Test/SauvLoaderTest.cxx @@ -26,7 +26,9 @@ #include "MEDCouplingMemArray.hxx" #ifdef WIN32 -# include +#include +#include +#define getcwd _getcwd #else # include #endif @@ -338,7 +340,7 @@ std::string SauvLoaderTest::getResourceFile( const std::string& filename ) resourceFile += "/share/resources/med/"; } else { - resourceFile = get_current_dir_name(); + resourceFile = getcwd(NULL, 0); resourceFile += "/../../../resources/"; } diff --git a/src/MEDPartitioner/Test/MEDPARTITIONERTest.cxx b/src/MEDPartitioner/Test/MEDPARTITIONERTest.cxx index 242de7f99..30c3a863e 100644 --- a/src/MEDPartitioner/Test/MEDPARTITIONERTest.cxx +++ b/src/MEDPartitioner/Test/MEDPARTITIONERTest.cxx @@ -43,7 +43,12 @@ #include #include #include +#ifdef WIN32 +#include +#define getcwd _getcwd +#else #include +#endif #ifdef HAVE_MPI #include @@ -92,7 +97,7 @@ std::string MEDPARTITIONERTest::getPartitionerExe() const } else { - execName = get_current_dir_name(); + execName = getcwd(NULL, 0); execName += "/../../MEDPartitioner/medpartitioner"; if (! std::ifstream(execName.c_str())) CPPUNIT_FAIL("Can't find medpartitioner, please set MEDCOUPLING_ROOT_DIR");