problems porting Common-C++

Felix Natter f.natter@ndh.net
Tue Jun 19 11:41:00 GMT 2001


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



More information about the Libstdc++ mailing list