Mail Archives: djgpp/2001/11/06/08:37:40
Nathan Smith wrote:
> It seems to me GCC 3 and GCC 2 do some things differently
>
> before I'd do something like:
> int mode_in=(ios::in | ios::binary | ios::nocreate);
> fstream filein(filename,mode_in);
>
> and it would work. Now it doesn't. Any docs on how all these things
> are done with GCC3?
I think ISO C++ 1998 standard is the reference. But you can mavigate in the
headers, they usually have references to the point in the standard where
each member is defined.
The headers are quite hard to read because now *all* the standard classes
are templates and what you use is usually a standard instance.
I had to change a lot of code in Turbo Vision to get it compiled with v3 of
the C++ library. Some problems are just a lack of namespace specification
std::OLDVALUE is often needed.
I'm using a header that makes my code compilable with gcc 2.x and 3.x (also
BC++ and MSVC), in this header I declare things like:
// ISO C++ 1998 standard changed a lot of details in the standard C++
// library. GCC implemented it in version 3.0. BC++ implemented some
// stuff in versions like BC++ 5.5. So that's a real mess.
#if __GNUC__>=3
#define CLY_ISOCpp98 1
#define CLY_OpenModeT std::ios::openmode
#define CLY_StreamPosT std::streampos
#define CLY_StreamOffT std::streamoff
#define CLY_IOSSeekDir std::ios::seekdir
#define CLY_FBOpenProtDef 0
#define CLY_NewFBFromFD(f) new
filebuf(fdopen(f,"rb+"),ios::in|ios::out|ios::b
#define CLY_PubSetBuf(a,b) pubsetbuf(a,b)
#undef CLY_HaveFBAttach
#define CLY_FBOpen(a,b,c) open(a,b)
#define CLY_IOSBin std::ios::binary
#define CLY_PubSeekOff pubseekoff
#define CLY_PubSync pubsync
#define CLY_std(a) std::a
#define UsingNamespaceStd using namespace std;
#define CreateStrStream(os,buf,size) std::string buf; std::ostringstream
os(bu
#define GetStrStream(buf) buf.c_str()
#ifdef Uses_StrStream
#define Include_sstream
#endif
#undef FSTREAM_HEADER
#define FSTREAM_HEADER <fstream>
#undef IOMANIP_HEADER
#define IOMANIP_HEADER <iomanip>
#undef IOSTREAM_HEADER
#define IOSTREAM_HEADER <iostream>
#else
#define CLY_OpenModeT int
#define CLY_StreamPosT streampos
#define CLY_StreamOffT streamoff
#define CLY_IOSSeekDir ios::seek_dir
#define CLY_FBOpenProtDef filebuf::openprot
#define CLY_NewFBFromFD(f) new filebuf(f)
#define CLY_PubSetBuf(a,b) setbuf(a,b)
#define CLY_HaveFBAttach 1
#define CLY_FBOpen(a,b,c) open(a,b,c)
#define CLY_IOSBin ios::bin
#define CLY_PubSeekOff seekoff
#define CLY_PubSync sync
#define CLY_std(a) a
#define UsingNamespaceStd
#define CreateStrStream(os,buf,size) char buf[size]; \
ostrstream os(buf,sizeof(buf))
#define GetStrStream(buf) buf
#ifdef Uses_StrStream
#define Include_strstream
#endif
#endif
As you can see one of the problems you could be experimenting is the lack of
std::
SET
--
Salvador Eduardo Tropea (SET). (Electronics Engineer)
Visit my home page: http://welcome.to/SetSoft or
http://www.geocities.com/SiliconValley/Vista/6552/
Alternative e-mail: set AT computer DOT org set AT ieee DOT org
Address: Curapaligue 2124, Caseros, 3 de Febrero
Buenos Aires, (1678), ARGENTINA Phone: +(5411) 4759 0013
- Raw text -