Mail Archives: djgpp-workers/2001/10/26/08:42:55
On Fri, 26 Oct 2001, Andrew Cottrell wrote:
> Andris,
>
> Thanks for the email. I have just downloaded the bianries and source. I just
> started the djconfig.sh and will check out the results in the morning, first
> 5 minutes of the build looks okay.
>
>
> > Perhaps not. I think it should be Ok to be used. Only fix I'm thinking
> > about is small fix for lang/cxx-v3/bits/fstream.tcc. But it is a new thing
> > and has got too little testing yet
>
> I will build it this weekend and start using it and if it looks okay I will
> upload the Win XP / 2K in 3 or 4 days if iot works okay.
This fix is not yet in. Here are diffs for
libstdc++-v3/include/std/fstream.tcc:
--- bits/fstream.tcc~1 Wed Oct 24 16:56:10 2001
+++ bits/fstream.tcc Fri Oct 26 13:15:42 2001
@@ -409,9 +409,23 @@
#if 1
int __plen = _M_out_end - _M_out_beg;
streamsize __len = 0;
-
+#ifdef __DJGPP__
+ int __plen0 = _M_out_cur - _M_out_beg;
+ streamoff __pos=0;
+ if (__plen0)
+ {
+ __len = _M_file->xsputn(_M_out_beg, __plen);
+ _M_file->sync();
+ }
+ if (__plen>__plen0)
+ {
+ __pos = _M_file->seekoff(0, ios_base::cur);
+ __len += _M_file->xsputn(_M_out_cur, __plen-__plen0);
+ }
+#else /* !__DJGPP__ */
if (__plen)
__len = _M_file->xsputn(_M_out_beg, __plen);
+#endif
if (__c !=traits_type::eof())
{
@@ -423,6 +437,10 @@
// NB: Need this so that external byte sequence reflects
// internal buffer.
_M_file->sync();
+#ifdef __DJGPP__
+ if (__plen!=__plen0)
+ _M_file->seekpos(__pos);
+#endif
if (__len == __plen)
{
_M_set_indeterminate();
This patch fixes filebuf test failure introduced by earlier patch for
std_fstream.h to fix DOS style (CR LF) file handling on output. Test
fails later anyway as it expects only LF to be written to file when LF
if sent to filebuf.
I'm sending this also to djgpp-workers as patch could be usefull to
somebody else
Andris
- Raw text -