diff options
author | wlemb <wlemb> | 2004-02-19 08:27:15 +0000 |
---|---|---|
committer | wlemb <wlemb> | 2004-02-19 08:27:15 +0000 |
commit | cd1ec86bc5a464538e0773af976d362fc0945370 (patch) | |
tree | ef696285ac24315e490afbf432390a8abd65647b /src/include | |
parent | 48052a79983ffada685c5e9bafe0ed8d3ec8b30f (diff) | |
download | groff-cd1ec86bc5a464538e0773af976d362fc0945370.tar.gz |
* font/devlj4/Makefile.sub (DEVFILES): Updated to contain all
new font and mapping files.
* src/include/nonposix.h (FLUSH_INPUT_PIPE): New macro to empty
an input pipe. This is needed for the MSVC compiler to make troff's
`-o' option work.
* src/roff/troff/div.cpp: Include nonposix.h.
(cleanup_and_exit): Call FLUSH_INPUT_PIPE.
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/nonposix.h | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/src/include/nonposix.h b/src/include/nonposix.h index a9e78cc4..a4f05c48 100644 --- a/src/include/nonposix.h +++ b/src/include/nonposix.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2000, 2001, 2002, 2003 Free Software Foundation, Inc. +/* Copyright (C) 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. Written by Eli Zaretskii (eliz@is.elta.co.il) This file is part of groff. @@ -29,8 +29,7 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #if defined(__MSDOS__) || defined(__EMX__) \ || (defined(_WIN32) && !defined(_UWIN) && !defined(__CYGWIN__)) -/* Binary I/O nuisances. Note: "setmode" is right for DJGPP and - Borland; Windows compilers might need _setmode or some such. */ +/* Binary I/O nuisances. */ # include <fcntl.h> # include <io.h> # ifdef HAVE_UNISTD_H @@ -57,7 +56,8 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ # define setmode(f,m) _setmode(f,m) # define WAIT(s,p,m) _cwait(s,p,m) # define creat(p,m) _creat(p,m) -# define read(f,b,s) _read(f,b,s) +# define read(f,b,s) _read(f,b,s) +# define isatty(f) _isatty(f) # endif # define SET_BINARY(f) do {if (!isatty(f)) setmode(f,O_BINARY);} while(0) # define FOPEN_RB "rb" @@ -120,6 +120,18 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #endif +#if defined(_WIN32) && !defined(__CYGWIN__) +# define FLUSH_INPUT_PIPE(fd) \ + do if (!isatty(fd)) \ + { \ + char drain[BUFSIZ]; \ + while (read(fd, drain, sizeof(drain)) > 0) \ + ; \ + } while (0) +#else +# define FLUSH_INPUT_PIPE(fd) do {} while(0) +#endif + /* Defaults, for Posix systems. */ #ifndef SET_BINARY |