]> Creatis software - crea.git/commitdiff
Feature #1711
authorDaniel Gonzalez <daniel.gonzalez@creatis.insa-lyon.fr>
Thu, 24 Jan 2013 20:58:06 +0000 (21:58 +0100)
committerDaniel Gonzalez <daniel.gonzalez@creatis.insa-lyon.fr>
Thu, 24 Jan 2013 20:58:06 +0000 (21:58 +0100)
CreaDevManager application implementation

- Changes for windows compatibility Tree hangs because of ids impossibility of recognition.
- Fix warnings because of < operator.
- Change to use of stable functions.

lib/creaDevManagerLib/modelCDMMain.cpp
lib/creaDevManagerLib/modelCDMProject.cpp

index fa5a96fe6931bbe00025a8a822487dd3b9c5e032..58469c22f994221f3b03f1e787c7dbc19e32084c 100644 (file)
@@ -177,8 +177,12 @@ bool modelCDMMain::OpenProject(
   //check if Makefile file exists
   std::string pathMakefile = pathFixed + CDMUtilities::SLASH + "Makefile";
   FILE* pFile;
+#ifdef _WIN32
   errno_t errorOpen = fopen_s(&pFile, pathMakefile.c_str(), "r");
-
+#else
+  pFile = fopen(pathMakefile.c_str(), "r");
+  bool errorOpen = (pFile == NULL);
+#endif
   //is the binary folder
   if (!errorOpen && pFile)
     {
@@ -207,7 +211,12 @@ bool modelCDMMain::OpenProject(
   std::string pathSource = "";
   //check if CMakeLists file exists
   std::string pathCMakeLists = pathFixed + CDMUtilities::SLASH + "CMakeLists.txt";
+#ifdef _WIN32
   errorOpen = fopen_s(&pFile, pathCMakeLists.c_str(), "r");
+#else
+  pFile = fopen(pathCMakeLists.c_str(), "r");
+  errorOpen = (pFile == NULL);
+#endif
 
   //is the source folder
   if (!errorOpen && pFile)
index 14422b6286332463bbe1fa7f82e6b9db64d8ed32..2996910dc4711d9f2b40a215b04ac443e561c895 100644 (file)
@@ -263,7 +263,11 @@ bool modelCDMProject::SetVersion(const std::string& version, std::string*& resul
   time_t now = time(0);
 
   tm ltm;
+#ifdef _WIN32
   localtime_s(&ltm, &now);
+#else
+  ltm = *(localtime(&now));
+#endif
 
   std::stringstream date;
   date << ltm.tm_mday << "/" << 1 + ltm.tm_mon << "/" << 1900 + ltm.tm_year;