aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Faylor <cgf@redhat.com>2002-12-04 02:20:24 +0000
committerChristopher Faylor <cgf@redhat.com>2002-12-04 02:20:24 +0000
commit064127a8840e2307e082f286c341b9a34a4ce75c (patch)
tree80d152994414ee1b177f3fc1d135df040a88ff48
parent7256c6cdf1e66d4aa97b706a2da12567cb79069b (diff)
* cppfiles.c (TEST_THRESHOLD): New macro.
(SHOULD_MMAP): Ditto. (read_include_file): Use SHOULD_MMAP macro to decide when mmap should be used. git-svn-id: https://gcc.gnu.org/svn/gcc/branches/cygwin-mingw-gcc-3_2_1-branch@59798 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog.cygwin-mingw7
-rw-r--r--gcc/cppfiles.c12
2 files changed, 18 insertions, 1 deletions
diff --git a/gcc/ChangeLog.cygwin-mingw b/gcc/ChangeLog.cygwin-mingw
index 8da004071e3..a6dffd5f787 100644
--- a/gcc/ChangeLog.cygwin-mingw
+++ b/gcc/ChangeLog.cygwin-mingw
@@ -1,3 +1,10 @@
+2002-01-13 Christopher Faylor <cgf@redhat.com>
+
+ * cppfiles.c (TEST_THRESHOLD): New macro.
+ (SHOULD_MMAP): Ditto.
+ (read_include_file): Use SHOULD_MMAP macro to decide when mmap should
+ be used.
+
2002-08-16 Danny Smith <dannysmith@users.sourceforge.net>
crtstuff.c (__do_frame_init): Call __w32_sharedptr_initialize.
diff --git a/gcc/cppfiles.c b/gcc/cppfiles.c
index 7c625ef6424..cad35c2c5b3 100644
--- a/gcc/cppfiles.c
+++ b/gcc/cppfiles.c
@@ -41,7 +41,17 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
at least one readable NUL byte after the end of the file's
contents. This is true for all tested operating systems when
the file size is not an exact multiple of the page size. */
-# define SHOULD_MMAP(size, pagesize) TEST_THRESHOLD (size, pagesize)
+# ifndef __CYGWIN__
+# define SHOULD_MMAP(size, pagesize) TEST_THRESHOLD (size, pagesize)
+# else
+# define WIN32_LEAN_AND_MEAN
+# include <windows.h>
+ /* Cygwin can't correctly emulate mmap under Windows 9x style systems so
+ disallow use of mmap on those systems. Windows 9x does not zero fill
+ memory at EOF and beyond, as required. */
+# define SHOULD_MMAP(size, pagesize) ((GetVersion() & 0x80000000) \
+ ? 0 : TEST_THRESHOLD (size, pagesize))
+# endif
# endif
#else /* No MMAP_FILE */