X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2FcreaDevManagerLib%2FmodelCDMMain.cpp;h=58469c22f994221f3b03f1e787c7dbc19e32084c;hb=6a43a8cc1e5216f06e41799fbe154b2b1ef6d44b;hp=7b47e90035841b8cafb42d19a26113b6246ba121;hpb=698d779d5af904401fa3640f9a2e1c9a3f4aad28;p=crea.git diff --git a/lib/creaDevManagerLib/modelCDMMain.cpp b/lib/creaDevManagerLib/modelCDMMain.cpp index 7b47e90..58469c2 100644 --- a/lib/creaDevManagerLib/modelCDMMain.cpp +++ b/lib/creaDevManagerLib/modelCDMMain.cpp @@ -176,10 +176,15 @@ bool modelCDMMain::OpenProject( //check if Makefile file exists std::string pathMakefile = pathFixed + CDMUtilities::SLASH + "Makefile"; - FILE* pFile = fopen(pathMakefile.c_str(), "r"); - + 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 (pFile != NULL) + if (!errorOpen && pFile) { fclose(pFile); std::ifstream readFile; @@ -206,10 +211,15 @@ 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 (pFile != NULL) + if (!errorOpen && pFile) { fclose(pFile); std::ifstream readFile;