From: Daniel Gonzalez Date: Thu, 24 Jan 2013 20:58:06 +0000 (+0100) Subject: Feature #1711 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=a9365e98724ef545368a3212e32263cd331d41d0;hp=72a6140565ccd0905f822c7bf17ea471762a9301;p=crea.git Feature #1711 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. --- diff --git a/lib/creaDevManagerLib/modelCDMMain.cpp b/lib/creaDevManagerLib/modelCDMMain.cpp index fa5a96f..58469c2 100644 --- a/lib/creaDevManagerLib/modelCDMMain.cpp +++ b/lib/creaDevManagerLib/modelCDMMain.cpp @@ -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) diff --git a/lib/creaDevManagerLib/modelCDMProject.cpp b/lib/creaDevManagerLib/modelCDMProject.cpp index 14422b6..2996910 100644 --- a/lib/creaDevManagerLib/modelCDMProject.cpp +++ b/lib/creaDevManagerLib/modelCDMProject.cpp @@ -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(<m, &now); +#else + ltm = *(localtime(&now)); +#endif std::stringstream date; date << ltm.tm_mday << "/" << 1 + ltm.tm_mon << "/" << 1900 + ltm.tm_year;