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]

problems porting Common-C++


hi,

I am currently trying to port commoncpp (Common-C++, can be found
on a GNU-mirror) to gcc 3.x, and I have a few problems:

- i/ostream::init(streambuf*): make this publicly accessible ?:
this is used in classes that derive from e.g. streambuf + iostream,
so that streambuf is initalized when iostream uses it.
(but this problem could potentially be worked around by inheriting in the
right order, I don't know)

- socket.cpp: missing std::streambuf::setb(...):
what does this do ? is it necessary or can it be replaced ?

here is the code that uses it:
void TCPStream::Allocate(int size)
{
	if(size < 2)
	{
		bufsize = 1;
		return;
	}

	gbuf = new char[size];
	pbuf = new char[size];
	if(!pbuf || !gbuf)
	{
		Error(SOCKET_RESOURCE_FAILURE);
		return;
	}
	bufsize = size;
	clear();
	setb(gbuf, gbuf + size, 0);
	setg(gbuf, gbuf + size, gbuf + size);
	setp(pbuf, pbuf + size);
}

-- 
Felix Natter


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