From de9faa82b7f47b27ae1bf30175350510229746d7 Mon Sep 17 00:00:00 2001 From: Dave Goodwin Date: Fri, 2 Feb 2007 19:24:19 +0000 Subject: [PATCH] windows bug fixes by Bert Bell --- Cantera/src/ct2ctml.cpp | 3 ++- Cantera/src/misc.cpp | 9 +++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/Cantera/src/ct2ctml.cpp b/Cantera/src/ct2ctml.cpp index 3aa3a569f..443d500ea 100644 --- a/Cantera/src/ct2ctml.cpp +++ b/Cantera/src/ct2ctml.cpp @@ -151,7 +151,8 @@ namespace ctml { // then clean up by deleting the temporary Python file. #ifndef DEBUG_PATHS #ifdef WIN32 - cmd = "cmd /C rm " + path; + //cmd = "cmd /C rm " + path; + remove(path.c_str()) ; #else cmd = "rm -f " + path; try { diff --git a/Cantera/src/misc.cpp b/Cantera/src/misc.cpp index 239cdddf1..e7076292c 100755 --- a/Cantera/src/misc.cpp +++ b/Cantera/src/misc.cpp @@ -29,6 +29,10 @@ #undef DEBUG_PATHS #include +#ifdef WIN32 +#include +#include +#endif using namespace std; namespace Cantera { @@ -214,6 +218,11 @@ namespace Cantera { // so it is replaced by: path = findInputFile(file); // +#ifdef WIN32 + // RFB: For Windows make the path POSIX compliant so code looking for directory + // separators is simpler. Just look for '/' not both '/' and '\\' + replace_if( path.begin(), path.end(), bind2nd( equal_to(), '\\'), '/' ) ; +#endif string ff = path; if (app()->xmlfiles.find(path)