This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: CPP warnings under DJGPP


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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]