]> SALOME platform Git repositories - tools/medcoupling.git/commitdiff
Salome HOME
Windows compatibility
authorana <ana@opencascade.com>
Fri, 18 Dec 2015 09:12:38 +0000 (12:12 +0300)
committerana <ana@opencascade.com>
Fri, 18 Dec 2015 09:12:38 +0000 (12:12 +0300)
src/INTERP_KERNELTest/TestInterpKernelUtils.cxx
src/MEDLoader/Test/MEDLoaderTest.cxx
src/MEDLoader/Test/SauvLoaderTest.cxx
src/MEDPartitioner/Test/MEDPARTITIONERTest.cxx

index 262699a35a47a40430e8388acdb5a3f076f225de..5adeb43fc15ee2b67c8588b9550ef92fff8b29f0 100644 (file)
 #include "InterpKernelException.hxx"
 
 #include <cstdlib>
+#ifdef WIN32
+#include<direct.h>
+#define getcwd _getcwd
+#else
 #include <unistd.h>
+#endif
 #include <sstream>
 #include <fstream>
 
@@ -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())
index 84a59d8ba0b93bedb8631c37705bbba42c6cd494..63c330188602d666fc0b411d61a95b09420a6636 100644 (file)
 
 #include <cmath>
 #include <numeric>
-#include <unistd.h>  // get_current_dir_name()
-
+#ifdef WIN32
+#include<direct.h>
+#define getcwd _getcwd
+#else
+#include <unistd.h>
+#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/";
   }
 
index 6ac13e4fee291288b46196c1b8ad454d963a494d..1674cffecc6a5bf087ba6d023929f8ea5d8ab291 100644 (file)
@@ -26,7 +26,9 @@
 #include "MEDCouplingMemArray.hxx"
 
 #ifdef WIN32
-# include <windows.h>
+#include <windows.h>
+#include <direct.h>
+#define getcwd _getcwd
 #else
 # include <unistd.h>
 #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/";
   }
 
index 242de7f99266ad75db0d22995e50734b7ca82dd7..30c3a863eaa987cc1004815c1bcc3fdb43b2494d 100644 (file)
 #include <stdexcept>
 #include <cstdlib>
 #include <vector>
+#ifdef WIN32
+#include<direct.h>
+#define getcwd _getcwd
+#else
 #include <unistd.h>
+#endif
 
 #ifdef HAVE_MPI
 #include <mpi.h>
@@ -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");