Fridrich, OK, I'll look up the pragma again. I'll be off the air for a while, should get back to it in a week or so.
David At 01:03 am 09/04/2007, Fridrich Strba wrote: >-----BEGIN PGP SIGNED MESSAGE----- >Hash: SHA1 > >Hello, > >David Hislop wrote: > >> It is possible that the msvc iostream implementation has some differences > > So obviously there is something different in MSVC iostream. I think it's > > in basic_istream (and so probably basic_ostream as well). It seems that > > the d->buffer << d->file.rdbuf() in WPSFileStream::isOLEStream() resets > > the buffer counts to make the buffer empty. Actually, that probably > > makes sense (I can't believe I said that about an MS-Anything :-) ). > > Anyway, their implementation seems to differ from the one at > > www.cplusplus.com <http://www.cplusplus.com/> , for example. > >Yeah :-) It has to be my fault because I had problems with resetting the >failbit eofbit and badbit on some systems, I replaced the read with >readsome. Now, I read the www.cplusplus.com again and I realize that >this is what they write: >"Reads a block of data of up to n characters and stores it in the array >pointed by s, but unlike member function read, readsome stops reading if >the memory buffer associated with the stream runs out of characters, >even if the End-Of-File has not yet been reached." >So, I replaced it again with a checked read and it should be working >now. In the fs_experimental branch I want to say. > > > Yes. I'm currently using the code below just directly in what would be > > WPXStreamImplementation.cpp, but if you choose to use something similar, > > it could perhaps be better in libwpd_internal.h. > > #if (defined(_MSC_VER) && (_MSC_VER >= 1400)) // 1400 for Visual > > Studio 2005 > > // From Visual Studio 2005, readsome() and read() are deprecated. > > #define myReadSome(BUF, SIZ, NUM) _Readsome_s(BUF, SIZ, NUM); > > #define myRead(BUF, SIZ, NUM) _Read_s(BUF, SIZ, NUM); > > #else // WIN32 > > #define myReadSome(BUF, SIZ, NUM) readsome(BUF, NUM); > > #define myRead(BUF, SIZ, NUM) read(BUF, NUM); > > #endif // WIN32 > >My problem with this approach is that static library built with VS2005 >will not be usable with the earlier MSVC versions. The linking will not >find a symbol that does not exist in the earlier version (AFAIK). So, if >one wants a really warning-free code, maybe a pragma to suppress this >warning would do better :-) > >Cheers > >F. > >- -- >Please avoid sending me Word, Excel or PowerPoint attachments. >See http://www.gnu.org/philosophy/no-word-attachments.html >-----BEGIN PGP SIGNATURE----- >Version: GnuPG v1.4.2 (GNU/Linux) >Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org > >iD8DBQFGGQRDu9a1imXPdA8RAnODAJ94W485AtLkX7AvuiS8FkxvnifqPACbBJU3 >yppHIbRx/CHawgL1WA3055o= >=sEeC >-----END PGP SIGNATURE----- ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ Libwpd-devel mailing list Libwpd-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/libwpd-devel