Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/winsup
diff options
context:
space:
mode:
authorDanny Smith <dannysmith@users.sourceforge.net>2004-04-01 14:04:04 +0400
committerDanny Smith <dannysmith@users.sourceforge.net>2004-04-01 14:04:04 +0400
commit4fc406c935d3896553e5f925e271428f92996d3c (patch)
tree6e4924661202eee270e6f9bce33112ae5f87da26 /winsup
parent54aefcc6bc3422afd8b59b000202e17bf3baab2d (diff)
* crt1.c (_mingw32_init_fmode): Set *_imp___fmode_dll to
_fmode if not __MSVCRT__.
Diffstat (limited to 'winsup')
-rw-r--r--winsup/mingw/ChangeLog5
-rw-r--r--winsup/mingw/crt1.c6
2 files changed, 11 insertions, 0 deletions
diff --git a/winsup/mingw/ChangeLog b/winsup/mingw/ChangeLog
index b72927803..23fd99e64 100644
--- a/winsup/mingw/ChangeLog
+++ b/winsup/mingw/ChangeLog
@@ -1,3 +1,8 @@
+2004-04-01 Danny Smith <dannysmith@users.sourceforge.net>
+
+ * crt1.c (_mingw32_init_fmode): Set *_imp___fmode_dll to
+ _fmode if not __MSVCRT__.
+
2004-03-30 Danny Smith <dannysmith@users.sourceforge.net>
* include/io.h: (_findfirst): Correct prototype.
diff --git a/winsup/mingw/crt1.c b/winsup/mingw/crt1.c
index e589b4c14..674bfe3b4 100644
--- a/winsup/mingw/crt1.c
+++ b/winsup/mingw/crt1.c
@@ -68,7 +68,9 @@ __MINGW_IMPORT void __set_app_type(int);
/* Override the dllimport'd declarations in stdlib.h */
#undef _fmode
extern int _fmode;
+#ifdef __MSVCRT__
extern int* __p__fmode(void); /* To access the dll _fmode */
+#endif
/*
* Setup the default file handles to have the _CRT_fmode mode, as well as
@@ -106,7 +108,11 @@ _mingw32_init_fmode ()
}
/* Now sync the dll _fmode to the one for this .exe. */
+#ifdef __MSVCRT__
*__p__fmode() = _fmode;
+#else
+ *_imp___fmode_dll = _fmode;
+#endif
}