diff --git a/src/parser/parser.cpp b/src/parser/parser.cpp index a6daeeb76..4e0a0463e 100644 --- a/src/parser/parser.cpp +++ b/src/parser/parser.cpp @@ -7,6 +7,9 @@ #include #include +#if defined MACOSX + #include +#endif #include #include #include @@ -63,7 +66,11 @@ mrmc::parser::MappedFile::MappedFile(const char* filename) * Do file mapping for reasonable systems. * stat64(), open(), mmap() */ +#ifdef MACOSX + if (stat(filename, &(this->st)) != 0) +#else if (stat64(filename, &(this->st)) != 0) +#endif { LOG4CPLUS_ERROR(logger, "Error in stat(" << filename << ")."); throw exceptions::file_IO_exception("mrmc::parser::MappedFile Error in stat()"); @@ -76,7 +83,7 @@ mrmc::parser::MappedFile::MappedFile(const char* filename) throw exceptions::file_IO_exception("mrmc::parser::MappedFile Error in open()"); } - this->data = (char*) mmap(NULL, this->st.st_size, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, this->file, 0); + this->data = (char*) mmap(NULL, this->st.st_size, PROT_READ, MAP_PRIVATE, this->file, 0); if (this->data == (char*)-1) { close(this->file); diff --git a/src/utility/osDetection.h b/src/utility/osDetection.h index c6c863a60..da72a909f 100644 --- a/src/utility/osDetection.h +++ b/src/utility/osDetection.h @@ -2,10 +2,11 @@ #if defined __linux__ || defined __linux #define LINUX -#elif defined TARGET_OS_MAC || defined __apple__ +#elif defined TARGET_OS_MAC || defined __apple__ || defined __APPLE__ #define MACOSX + #define _DARWIN_USE_64_BIT_INODE #elif defined _WIN32 || defined _WIN64 #define WINDOWS #else #error Could not detect Operating System -#endif \ No newline at end of file +#endif