This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: CPP warnings under DJGPP
- To: Per Bothner <per at bothner dot com>
- Subject: Re: CPP warnings under DJGPP
- From: Laurynas Biveinis <lauras at softhome dot net>
- Date: Wed, 31 May 2000 22:05:53 +0300
- CC: GCC Patches <gcc-patches at gcc dot gnu dot org>
- References: <3933FCBD.D9B0197E@softhome.net> <m24s7fj1u8.fsf@kelso.bothner.com>
Per Bothner wrote:
> I've used
> #ifndef O_BINARY
> #define O_BINARY 0
> #endif
> as a relatively clean solution to this DOS brain-damage.
OK, what about following?
2000-05-31 Laurynas Biveinis <lauras@softhome.net>
* cppfiles.c: conditionally define O_BINARY.
(open_include_file): pass O_BINARY to open().
--- cvs/gcc/gcc/cppfiles.c Mon May 29 19:42:24 2000
+++ gcc/gcc/cppfiles.c Wed May 31 21:36:22 2000
@@ -39,6 +39,10 @@
# define MMAP_THRESHOLD 0
#endif
+#ifndef O_BINARY
+# define O_BINARY 0
+#endif
+
static IHASH *redundant_include_p PARAMS ((IHASH *, struct file_name_list *));
static IHASH *make_IHASH PARAMS ((const char *, const char *,
struct file_name_list *,
@@ -223,7 +227,7 @@
cpp_reader *pfile ATTRIBUTE_UNUSED;
const char *filename;
{
- return open (filename, O_RDONLY|O_NOCTTY, 0666);
+ return open (filename, O_RDONLY|O_NOCTTY|O_BINARY, 0666);
}
/* Search for include file FNAME in the include chain starting at