From 4f7cbd450a845d6a5fbcc6063b70ad1b7faeb534 Mon Sep 17 00:00:00 2001 From: PBerger Date: Sat, 1 Dec 2012 15:31:34 +0100 Subject: [PATCH] Fixed bugs in the Windows Part of the parser, refactored includes to meet Windows Requirements. Deleted a #warning --- src/formula/BoundedUntil.h | 4 +++- src/parser/parser.h | 9 ++++----- src/parser/readLabFile.cpp | 6 +++++- src/parser/readTraFile.cpp | 5 ++++- 4 files changed, 16 insertions(+), 8 deletions(-) diff --git a/src/formula/BoundedUntil.h b/src/formula/BoundedUntil.h index bc1510fe3..425e5afaf 100644 --- a/src/formula/BoundedUntil.h +++ b/src/formula/BoundedUntil.h @@ -9,6 +9,8 @@ #define BOUNDEDUNTIL_H_ #include "PCTLPathFormula.h" +#include "PCTLStateFormula.h" +#include "boost/integer/integer_mask.hpp" namespace mrmc { @@ -62,7 +64,7 @@ class BoundedUntil : public PCTLPathFormula { std::string result = "("; result += left->toString(); result += " U<="; - result += bound; + result += std::to_string(bound); result += " "; result += right->toString(); result += ")"; diff --git a/src/parser/parser.h b/src/parser/parser.h index f1b772040..584019b99 100644 --- a/src/parser/parser.h +++ b/src/parser/parser.h @@ -49,7 +49,7 @@ namespace parser { #if defined LINUX || defined MACOSX int file; #elif defined WINDOWS - HFILE file; + HANDLE file; HANDLE mapping; #endif @@ -110,7 +110,6 @@ namespace parser { } this->dataend = this->data + this->st.st_size; #elif defined WINDOWS -#warning Windows support is implemented but has not been compiled yet... /* * Do file mapping for windows. * _stat64(), CreateFile(), CreateFileMapping(), MapViewOfFile() @@ -121,14 +120,14 @@ namespace parser { throw exceptions::file_IO_exception("mrmc::parser::MappedFile Error in stat()"); } - this->file = CreateFile(filename, GENERIC_READ, 0, NULL, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); + this->file = CreateFileA(filename, GENERIC_READ, 0, NULL, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); if (this->file == INVALID_HANDLE_VALUE) { pantheios::log_ERROR("Could not open ", filename, ". Does it exist? Is it readable?"); throw exceptions::file_IO_exception("mrmc::parser::MappedFile Error in CreateFile()"); } - this->mapping = CreateFileMapping(this->file, NULL, PAGE_READONLY, (DWORD)(st.st_size >> 32), (DWORD)st.st_size, NULL); + this->mapping = CreateFileMappingA(this->file, NULL, PAGE_READONLY, (DWORD)(st.st_size >> 32), (DWORD)st.st_size, NULL); if (this->mapping == NULL) { CloseHandle(this->file); @@ -136,7 +135,7 @@ namespace parser { throw exceptions::file_IO_exception("mrmc::parser::MappedFile Error in CreateFileMapping()"); } - this->data = MapViewOfFile(this->mapping, FILE_MAP_READ, 0, 0, this->st.st_size); + this->data = static_cast(MapViewOfFile(this->mapping, FILE_MAP_READ, 0, 0, this->st.st_size)); if (this->data == NULL) { CloseHandle(this->mapping); diff --git a/src/parser/readLabFile.cpp b/src/parser/readLabFile.cpp index f910e8dce..01c44d420 100644 --- a/src/parser/readLabFile.cpp +++ b/src/parser/readLabFile.cpp @@ -20,7 +20,11 @@ #include #include #include -#include +#if defined LINUX || defined MACOSX + #include +#elif defined WINDOWS +#define strncpy strncpy_s +#endif #include #include diff --git a/src/parser/readTraFile.cpp b/src/parser/readTraFile.cpp index 335699138..e5e58baf5 100644 --- a/src/parser/readTraFile.cpp +++ b/src/parser/readTraFile.cpp @@ -19,7 +19,10 @@ #include #include #include -#include +#if defined LINUX || defined MACOSX + #include +#elif defined WINDOWS +#endif #include #include