X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Fbinary-io.h;h=2845ee73e62c2f7859a84a0b5850c362d72764a1;hb=cbb86267fda18ba3e409e16cf9c460cbbed1846c;hp=ed74c06f277c3d22327040e08d937b023d5a333a;hpb=1375fc09dca2c1dcfa98151c8e468b5bdb70b1bc;p=gnulib.git diff --git a/lib/binary-io.h b/lib/binary-io.h index ed74c06f2..2845ee73e 100644 --- a/lib/binary-io.h +++ b/lib/binary-io.h @@ -18,9 +18,14 @@ #ifndef _BINARY_H #define _BINARY_H -#include /* For systems that distinguish between text and binary I/O. O_BINARY is usually declared in . */ +#include + +/* The MSVC7 doesn't like to be included after '#define fileno ...', + so we include it here first. */ +#include + #if !defined O_BINARY && defined _O_BINARY /* For MSC-compatible compilers. */ # define O_BINARY _O_BINARY @@ -32,12 +37,14 @@ # undef O_TEXT #endif #if O_BINARY -# if !(defined __EMX__ || defined __DJGPP__) +# if !(defined __EMX__ || defined __DJGPP__ || defined __CYGWIN__) # define setmode _setmode # define fileno _fileno # endif -# ifdef __DJGPP__ +# if defined __DJGPP__ || defined __CYGWIN__ # include /* declares setmode() */ +# endif +# ifdef __DJGPP__ # include /* declares isatty() */ # /* Avoid putting stdin/stdout in binary mode if it is connected to the # console, because that would make it impossible for the user to @@ -48,6 +55,7 @@ # endif #else /* On reasonable systems, binary I/O is the default. */ +# undef O_BINARY # define O_BINARY 0 # define SET_BINARY(fd) /* nothing */ #endif