This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

v2 and v3 of libstdc++


Hi All

I am upgrading from 2.96 version of gcc to 3.2.1 version of gcc. it
seems that libstdc++ also has gone major changes in the course. 

Some of the isuues which I have faced till now are like (actually we are
in the process of supporting an old code base on linux with latest
available gcc)


Issue 1. nocreate and noreplace members have been removed from ios class

This is being used in the our code as

#if defined( _WIN32 )  
#define IOS_NOCREATE   0
#define IOS_NOREPLACE  0
#endif
#if defined( __unix )
#define IOS_NOCREATE    ios::nocreate
#define IOS_NOREPLACE   ios::noreplace
#endif

Solution: We have defined IOS_NOCREATE and IOS_NOREPLACE for linux same
as has been done for windows.

#define IOS_NOCREATE   0
#define IOS_NOREPLACE  0

Issue 2. open(const char*&, int&, int) is not a member of fstream class.
And Second member of the open method of fstream class has to be of type
ios_base::openmode 

This is being used as follows

#if defined( __unix )
                iostrm.open(fileName, op, 0644);
#endif // __unix
#if defined( _WIN32 )
                iostrm.open(fileName, op );
#endif // _WIN32

Solution: We have used the same approach as used for Windows
		    fstream iostrm;
			.
			.
                #ifdef __linux
                iostrm.open(fileName, (ios_base::openmode)op );
                #else
                iostrm.open(fileName, op, 0644);
                #endif

Issue 3. filebuf class does not have "fd" as its member function

This is being used in as follows.

   fstream iostrm;
	.
	.
   filebuf *b = iostrm.rdbuf();
   return b ? b->fd() : -1;

Solution: No solution found as yet.

Can somebody please comment on our solutions and suggest us with the
solution for the 4th.


Regards
Ajay



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]