From: Tim King Date: Wed, 24 Oct 2012 21:28:52 +0000 (+0000) Subject: Fix for systems that do not have the MAP_FILE macro defined. X-Git-Tag: cvc5-1.0.0~7677 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=203435906c670095b3b753077f09ad334f278bf7;p=cvc5.git Fix for systems that do not have the MAP_FILE macro defined. --- diff --git a/src/parser/memory_mapped_input_buffer.cpp b/src/parser/memory_mapped_input_buffer.cpp index 5c2523aab..ff3f8b27d 100644 --- a/src/parser/memory_mapped_input_buffer.cpp +++ b/src/parser/memory_mapped_input_buffer.cpp @@ -95,8 +95,14 @@ static ANTLR3_UINT32 MemoryMapFile(pANTLR3_INPUT_STREAM input, return ANTLR3_ERR_NOFILE; } - input->data = mmap(0, input->sizeBuf, PROT_READ, MAP_FILE | MAP_PRIVATE, fd, - 0); + +#ifndef MAP_FILE + //Tim: This is required for SunOS + input->data = mmap(0, input->sizeBuf, PROT_READ, MAP_PRIVATE, fd, 0); +#else + input->data = mmap(0, input->sizeBuf, PROT_READ, MAP_FILE | MAP_PRIVATE, fd, 0); +#endif + errno = 0; if(intptr_t(input->data) == -1) { return ANTLR3_ERR_NOMEM;