=================================================================== RCS file: /cvs/mandoc/read.c,v retrieving revision 1.14 retrieving revision 1.16 diff -u -p -r1.14 -r1.16 --- mandoc/read.c 2011/04/30 10:18:24 1.14 +++ mandoc/read.c 2011/07/17 12:52:54 1.16 @@ -1,4 +1,4 @@ -/* $Id: read.c,v 1.14 2011/04/30 10:18:24 kristaps Exp $ */ +/* $Id: read.c,v 1.16 2011/07/17 12:52:54 kristaps Exp $ */ /* * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons * Copyright (c) 2010, 2011 Ingo Schwarze @@ -19,8 +19,10 @@ #include "config.h" #endif -#include -#include +#ifdef HAVE_MMAP +# include +# include +#endif #include #include @@ -144,6 +146,9 @@ static const char * const mandocerrs[MANDOCERR_MAX] = "bad comment style", "bad escape sequence", "unterminated quoted string", + + /* related to equations */ + "unexpected literal in equation", "generic error", @@ -529,19 +534,22 @@ pdesc(struct mparse *curp, const char *file, int fd) mparse_buf_r(curp, blk, 1); +#ifdef HAVE_MMAP if (with_mmap) munmap(blk.buf, blk.sz); else +#endif free(blk.buf); } static int read_whole_file(const char *file, int fd, struct buf *fb, int *with_mmap) { - struct stat st; size_t off; ssize_t ssz; +#ifdef HAVE_MMAP + struct stat st; if (-1 == fstat(fd, &st)) { perror(file); return(0); @@ -566,6 +574,7 @@ read_whole_file(const char *file, int fd, struct buf * if (fb->buf != MAP_FAILED) return(1); } +#endif /* * If this isn't a regular file (like, say, stdin), then we must