From seenutn@cdotb.ernet.in Sat Jun 02 02:53:34 2001
Received: from [202.41.72.121] (helo=ws9.cdotb.ernet.in)
	by fencepost.gnu.org with esmtp (Exim 3.16 #1 (Debian))
	id 1565Ho-0001a1-00
	for <bug-commoncpp@gnu.org>; Sat, 02 Jun 2001 02:53:29 -0400
Received: from ws9.cdotb.ernet.in (IDENT:seenutn@[192.168.51.218])
	by ws9.cdotb.ernet.in (8.9.3/8.9.3) with ESMTP id MAA28516
	for <bug-commoncpp@gnu.org>; Sat, 2 Jun 2001 12:13:05 +0500 (GMT+0500)
Message-ID: <3B188E6F.6050105@ws9.cdotb.ernet.in>
Date: Sat, 02 Jun 2001 12:27:51 +0530
From: "Srinivasa T.N." <seenutn@cdotb.ernet.in>
Organization: C-DOT
User-Agent: Mozilla/5.0 (X11; U; Linux 2.2.14-5.0 i686; en-US; m18) Gecko/20010131 Netscape6/6.01
X-Accept-Language: en
MIME-Version: 1.0
To: bug-commoncpp@gnu.org
Subject: recv in TCPSession
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
Sender: bug-commoncpp-admin@gnu.org
Errors-To: bug-commoncpp-admin@gnu.org
X-BeenThere: bug-commoncpp@gnu.org
X-Mailman-Version: 2.0.3
Precedence: bulk
List-Help: <mailto:bug-commoncpp-request@gnu.org?subject=help>
List-Post: <mailto:bug-commoncpp@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=subscribe>
List-Id: Bug reports for Common C++ <bug-commoncpp.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=unsubscribe>
List-Archive: <http://mail.gnu.org/pipermail/bug-commoncpp/>

Hi All,
   In TCPSession, we can do "*tcp >>" insted of "recv" on the socket.  
But, Is there way to find the length of the buffer I received with >>, 
because I can do something like length == -1 or length == 0......
   Or, is it that I have to construct a class of my own deriving it from 
SocketPort and Thread...

Regards,
Seenu.

-- 
-----------------------------------------------------------------------------
If not here, you can reach me at seenutn@seenutn.org

C-DOT, 71/1, Sneha Complex, Miller Road, Bangalore - 560 052
Ph: 226 3399 Ext: 268  Direct: 238 3951 (Off)
    363 1707 (Resi)



From seenutn@cdotb.ernet.in Sat Jun 02 10:34:19 2001
Received: from [202.41.72.121] (helo=ws9.cdotb.ernet.in)
	by fencepost.gnu.org with esmtp (Exim 3.16 #1 (Debian))
	id 156CTk-0006Oi-00
	for <bug-commoncpp@gnu.org>; Sat, 02 Jun 2001 10:34:14 -0400
Received: from ws9.cdotb.ernet.in (IDENT:seenutn@[192.168.51.218])
	by ws9.cdotb.ernet.in (8.9.3/8.9.3) with ESMTP id TAA05170;
	Sat, 2 Jun 2001 19:53:21 +0500 (GMT+0500)
Message-ID: <3B18FA4E.5010202@ws9.cdotb.ernet.in>
Date: Sat, 02 Jun 2001 20:08:06 +0530
From: "Srinivasa T.N." <seenutn@cdotb.ernet.in>
Organization: C-DOT
User-Agent: Mozilla/5.0 (X11; U; Linux 2.2.14-5.0 i686; en-US; m18) Gecko/20010131 Netscape6/6.01
X-Accept-Language: en
MIME-Version: 1.0
To: David Sugar <dyfet@ostel.com>
CC: bug-commoncpp <bug-commoncpp@gnu.org>
Subject: Re: recv in TCPSession
References: <3B188E6F.6050105@ws9.cdotb.ernet.in> <3B18E339.4010603@ostel.com>
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
Sender: bug-commoncpp-admin@gnu.org
Errors-To: bug-commoncpp-admin@gnu.org
X-BeenThere: bug-commoncpp@gnu.org
X-Mailman-Version: 2.0.3
Precedence: bulk
List-Help: <mailto:bug-commoncpp-request@gnu.org?subject=help>
List-Post: <mailto:bug-commoncpp@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=subscribe>
List-Id: Bug reports for Common C++ <bug-commoncpp.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=unsubscribe>
List-Archive: <http://mail.gnu.org/pipermail/bug-commoncpp/>


David Sugar wrote:

> gcount() should return the number of bytes received from the last 
> stream operation.
> 
> Srinivasa T.N. wrote:
> 
>> Hi All,
>>   In TCPSession, we can do "*tcp >>" insted of "recv" on the socket.  
>> But, Is there way to find the length of the buffer I received with 
>>  >>, because I can do something like length == -1 or length == 0......
>>   Or, is it that I have to construct a class of my own deriving it 
>> from SocketPort and Thread...
>> 
>> Regards,
>> Seenu.
> 
I am using TCP fo communicating between Server and Client.  In Server, I 
want to read line by line that is sent by Client.  I am using Readline() 
function in Socket class.  I want to check error, but I dont want to use 
exceptions.  After Readline, gcount() alwaysreturn the length read or 
0.  If my client gets ^C, then at server gcount() returns me 0 (normally 
recv returns 0 but on other conditions -1, but gcount() always retuns 
+ve or 0)..  Due to this, my check is failing, what should I do for that????

Regards,
Seenu.

-- 
-----------------------------------------------------------------------------
If not here, you can reach me at seenutn@seenutn.org

C-DOT, 71/1, Sneha Complex, Miller Road, Bangalore - 560 052
Ph: 226 3399 Ext: 268  Direct: 238 3951 (Off)
    363 1707 (Resi)



From dyfet@ostel.com Sat Jun 02 11:24:35 2001
Received: from [63.124.177.154] (helo=home.sys)
	by fencepost.gnu.org with smtp (Exim 3.16 #1 (Debian))
	id 156DGU-0007Uw-00
	for <bug-commoncpp@gnu.org>; Sat, 02 Jun 2001 11:24:35 -0400
Received: from ostel.com (home.sys [172.16.1.254])
	by home.sys (Postfix) with ESMTP
	id 29C039FD80; Sat,  2 Jun 2001 11:23:21 -0400 (EDT)
Message-ID: <3B1904E8.3090800@ostel.com>
Date: Sat, 02 Jun 2001 11:23:20 -0400
From: David Sugar <dyfet@ostel.com>
Organization: OST
User-Agent: Mozilla/5.0 (X11; U; Linux 2.2.16-9mdk i686; en-US; m18) Gecko/20001013
X-Accept-Language: en
MIME-Version: 1.0
To: "Srinivasa T.N." <seenutn@cdotb.ernet.in>
Cc: bug-commoncpp <bug-commoncpp@gnu.org>
Subject: Re: recv in TCPSession
References: <3B188E6F.6050105@ws9.cdotb.ernet.in> <3B18E339.4010603@ostel.com> <3B18FA4E.5010202@ws9.cdotb.ernet.in>
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
Sender: bug-commoncpp-admin@gnu.org
Errors-To: bug-commoncpp-admin@gnu.org
X-BeenThere: bug-commoncpp@gnu.org
X-Mailman-Version: 2.0.3
Precedence: bulk
List-Help: <mailto:bug-commoncpp-request@gnu.org?subject=help>
List-Post: <mailto:bug-commoncpp@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=subscribe>
List-Id: Bug reports for Common C++ <bug-commoncpp.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=unsubscribe>
List-Archive: <http://mail.gnu.org/pipermail/bug-commoncpp/>

Why are you using Readline() rather than getline()?


Srinivasa T.N. wrote:

> 
> 
> David Sugar wrote:
> 
>> gcount() should return the number of bytes received from the last 
>> stream operation.
>> 
>> Srinivasa T.N. wrote:
>> 
>>> Hi All,
>>>   In TCPSession, we can do "*tcp >>" insted of "recv" on the socket.  
>>> But, Is there way to find the length of the buffer I received with 
>>>  >>, because I can do something like length == -1 or length == 0......
>>>   Or, is it that I have to construct a class of my own deriving it 
>>> from SocketPort and Thread...
>>> 
>>> Regards,
>>> Seenu.
>> 
>> 
> I am using TCP fo communicating between Server and Client.  In Server, I 
> want to read line by line that is sent by Client.  I am using Readline() 
> function in Socket class.  I want to check error, but I dont want to use 
> exceptions.  After Readline, gcount() alwaysreturn the length read or 
> 0.  If my client gets ^C, then at server gcount() returns me 0 (normally 
> recv returns 0 but on other conditions -1, but gcount() always retuns 
> +ve or 0)..  Due to this, my check is failing, what should I do for 
> that????
> 
> Regards,
> Seenu.



From seenutn@cdotb.ernet.in Sun Jun 03 05:22:10 2001
Received: from [202.41.72.121] (helo=ws9.cdotb.ernet.in)
	by fencepost.gnu.org with esmtp (Exim 3.16 #1 (Debian))
	id 156U5D-000404-00
	for <bug-commoncpp@gnu.org>; Sun, 03 Jun 2001 05:22:06 -0400
Received: from ws9.cdotb.ernet.in (IDENT:seenutn@[192.168.51.218])
	by ws9.cdotb.ernet.in (8.9.3/8.9.3) with ESMTP id OAA20846;
	Sun, 3 Jun 2001 14:41:31 +0500 (GMT+0500)
Message-ID: <3B19B560.6060907@ws9.cdotb.ernet.in>
Date: Sun, 03 Jun 2001 09:26:16 +0530
From: "Srinivasa T.N." <seenutn@cdotb.ernet.in>
Organization: C-DOT
User-Agent: Mozilla/5.0 (X11; U; Linux 2.2.14-5.0 i686; en-US; m18) Gecko/20010131 Netscape6/6.01
X-Accept-Language: en
MIME-Version: 1.0
To: David Sugar <dyfet@ostel.com>
CC: bug-commoncpp <bug-commoncpp@gnu.org>
Subject: Re: recv in TCPSession
References: <3B188E6F.6050105@ws9.cdotb.ernet.in> <3B18E339.4010603@ostel.com> <3B18FA4E.5010202@ws9.cdotb.ernet.in> <3B1904E8.3090800@ostel.com>
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
Sender: bug-commoncpp-admin@gnu.org
Errors-To: bug-commoncpp-admin@gnu.org
X-BeenThere: bug-commoncpp@gnu.org
X-Mailman-Version: 2.0.3
Precedence: bulk
List-Help: <mailto:bug-commoncpp-request@gnu.org?subject=help>
List-Post: <mailto:bug-commoncpp@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=subscribe>
List-Id: Bug reports for Common C++ <bug-commoncpp.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=unsubscribe>
List-Archive: <http://mail.gnu.org/pipermail/bug-commoncpp/>

Hi,
  I am getting a lin of socket and using Readline() provided by Common 
C++.  getline() reads input from iostream.....

Regards,
Seenu.


David Sugar wrote:

> Why are you using Readline() rather than getline()?
> 
> 
> Srinivasa T.N. wrote:
> 
>> 
>> 
>> David Sugar wrote:
>> 
>>> gcount() should return the number of bytes received from the last 
>>> stream operation.
>>> 
>>> Srinivasa T.N. wrote:
>>> 
>>>> Hi All,
>>>>   In TCPSession, we can do "*tcp >>" insted of "recv" on the 
>>>> socket.  But, Is there way to find the length of the buffer I 
>>>> received with  >>, because I can do something like length == -1 or 
>>>> length == 0......
>>>>   Or, is it that I have to construct a class of my own deriving it 
>>>> from SocketPort and Thread...
>>>> 
>>>> Regards,
>>>> Seenu.
>>> 
>>> 
>>> 
>> I am using TCP fo communicating between Server and Client.  In 
>> Server, I want to read line by line that is sent by Client.  I am 
>> using Readline() function in Socket class.  I want to check error, 
>> but I dont want to use exceptions.  After Readline, gcount() 
>> alwaysreturn the length read or 0.  If my client gets ^C, then at 
>> server gcount() returns me 0 (normally recv returns 0 but on other 
>> conditions -1, but gcount() always retuns +ve or 0)..  Due to this, 
>> my check is failing, what should I do for that????
>> 
>> Regards,
>> Seenu.
> 

-- 
-----------------------------------------------------------------------------
If not here, you can reach me at seenutn@seenutn.org

C-DOT, 71/1, Sneha Complex, Miller Road, Bangalore - 560 052
Ph: 226 3399 Ext: 268  Direct: 238 3951 (Off)
    363 1707 (Resi)



From dyfet@ostel.com Sun Jun 03 08:45:48 2001
Received: from [63.124.177.154] (helo=home.sys)
	by fencepost.gnu.org with smtp (Exim 3.16 #1 (Debian))
	id 156XGO-0006gG-00
	for <bug-commoncpp@gnu.org>; Sun, 03 Jun 2001 08:45:48 -0400
Received: from ostel.com (home.sys [172.16.1.254])
	by home.sys (Postfix) with ESMTP
	id 4DC3F9DBC6; Sun,  3 Jun 2001 08:44:42 -0400 (EDT)
Message-ID: <3B1A313A.9050007@ostel.com>
Date: Sun, 03 Jun 2001 08:44:42 -0400
From: David Sugar <dyfet@ostel.com>
Organization: OST
User-Agent: Mozilla/5.0 (X11; U; Linux 2.2.16-9mdk i686; en-US; m18) Gecko/20001013
X-Accept-Language: en
MIME-Version: 1.0
To: "Srinivasa T.N." <seenutn@cdotb.ernet.in>
Cc: bug-commoncpp <bug-commoncpp@gnu.org>
Subject: Re: recv in TCPSession
References: <3B188E6F.6050105@ws9.cdotb.ernet.in> <3B18E339.4010603@ostel.com> <3B18FA4E.5010202@ws9.cdotb.ernet.in> <3B1904E8.3090800@ostel.com> <3B19B560.6060907@ws9.cdotb.ernet.in>
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
Sender: bug-commoncpp-admin@gnu.org
Errors-To: bug-commoncpp-admin@gnu.org
X-BeenThere: bug-commoncpp@gnu.org
X-Mailman-Version: 2.0.3
Precedence: bulk
List-Help: <mailto:bug-commoncpp-request@gnu.org?subject=help>
List-Post: <mailto:bug-commoncpp@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=subscribe>
List-Id: Bug reports for Common C++ <bug-commoncpp.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=unsubscribe>
List-Archive: <http://mail.gnu.org/pipermail/bug-commoncpp/>

If your using a tcpstream based object then getline will read from the stream 
of the tcp connection, while Readline operates underneath the buffering. 
Readline returns a byte count or 0 if it cannot get any data.  getline uses 
the state mechanism and flags of the stream to signal when an "eof" has occured.

Srinivasa T.N. wrote:

> Hi,
>  I am getting a lin of socket and using Readline() provided by Common 
> C++.  getline() reads input from iostream.....
> 
> Regards,
> Seenu.
> 
> 
> David Sugar wrote:
> 
>> Why are you using Readline() rather than getline()?
>> 
>> 
>> Srinivasa T.N. wrote:
>> 
>>> 
>>> 
>>> David Sugar wrote:
>>> 
>>>> gcount() should return the number of bytes received from the last 
>>>> stream operation.
>>>> 
>>>> Srinivasa T.N. wrote:
>>>> 
>>>>> Hi All,
>>>>>   In TCPSession, we can do "*tcp >>" insted of "recv" on the 
>>>>> socket.  But, Is there way to find the length of the buffer I 
>>>>> received with  >>, because I can do something like length == -1 or 
>>>>> length == 0......
>>>>>   Or, is it that I have to construct a class of my own deriving it 
>>>>> from SocketPort and Thread...
>>>>> 
>>>>> Regards,
>>>>> Seenu.
>>>> 
>>>> 
>>>> 
>>>> 
>>> I am using TCP fo communicating between Server and Client.  In 
>>> Server, I want to read line by line that is sent by Client.  I am 
>>> using Readline() function in Socket class.  I want to check error, 
>>> but I dont want to use exceptions.  After Readline, gcount() 
>>> alwaysreturn the length read or 0.  If my client gets ^C, then at 
>>> server gcount() returns me 0 (normally recv returns 0 but on other 
>>> conditions -1, but gcount() always retuns +ve or 0)..  Due to this, 
>>> my check is failing, what should I do for that????
>>> 
>>> Regards,
>>> Seenu.
>> 
>> 



From seenutn@cdotb.ernet.in Sun Jun 03 09:27:29 2001
Received: from [202.41.72.121] (helo=ws9.cdotb.ernet.in)
	by fencepost.gnu.org with esmtp (Exim 3.16 #1 (Debian))
	id 156Xuh-0007Ut-00
	for <bug-commoncpp@gnu.org>; Sun, 03 Jun 2001 09:27:28 -0400
Received: from ws9.cdotb.ernet.in (IDENT:seenutn@[192.168.51.218])
	by ws9.cdotb.ernet.in (8.9.3/8.9.3) with ESMTP id SAA25633;
	Sun, 3 Jun 2001 18:47:28 +0500 (GMT+0500)
Message-ID: <3B1A3C5D.7070201@ws9.cdotb.ernet.in>
Date: Sun, 03 Jun 2001 19:02:13 +0530
From: "Srinivasa T.N." <seenutn@cdotb.ernet.in>
Organization: C-DOT
User-Agent: Mozilla/5.0 (X11; U; Linux 2.2.14-5.0 i686; en-US; m18) Gecko/20010131 Netscape6/6.01
X-Accept-Language: en
MIME-Version: 1.0
To: David Sugar <dyfet@ostel.com>
CC: bug-commoncpp <bug-commoncpp@gnu.org>
Subject: Re: recv in TCPSession
References: <3B188E6F.6050105@ws9.cdotb.ernet.in> <3B18E339.4010603@ostel.com> <3B18FA4E.5010202@ws9.cdotb.ernet.in> <3B1904E8.3090800@ostel.com> <3B19B560.6060907@ws9.cdotb.ernet.in> <3B1A313A.9050007@ostel.com>
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
Sender: bug-commoncpp-admin@gnu.org
Errors-To: bug-commoncpp-admin@gnu.org
X-BeenThere: bug-commoncpp@gnu.org
X-Mailman-Version: 2.0.3
Precedence: bulk
List-Help: <mailto:bug-commoncpp-request@gnu.org?subject=help>
List-Post: <mailto:bug-commoncpp@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=subscribe>
List-Id: Bug reports for Common C++ <bug-commoncpp.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=unsubscribe>
List-Archive: <http://mail.gnu.org/pipermail/bug-commoncpp/>

David Sugar wrote:

> If your using a tcpstream based object then getline will read from the 
> stream of the tcp connection, while Readline operates underneath the 
> buffering. Readline returns a byte count or 0 if it cannot get any 
> data.  getline uses the state mechanism and flags of the stream to 
> signal when an "eof" has occured.
> 
> Srinivasa T.N. wrote:
> 
>> Hi,
>>  I am getting a lin of socket and using Readline() provided by Common 
>> C++.  getline() reads input from iostream.....
>> 
>> Regards,
>> Seenu.
>> 
>> 
>> David Sugar wrote:
>> 
>>> Why are you using Readline() rather than getline()?
>>> 
>>> 
>>> Srinivasa T.N. wrote:
>>> 
>>>> 
>>>> 
>>>> David Sugar wrote:
>>>> 
>>>>> gcount() should return the number of bytes received from the last 
>>>>> stream operation.
>>>>> 
>>>>> Srinivasa T.N. wrote:
>>>>> 
>>>>>> Hi All,
>>>>>>   In TCPSession, we can do "*tcp >>" insted of "recv" on the 
>>>>>> socket.  But, Is there way to find the length of the buffer I 
>>>>>> received with  >>, because I can do something like length == -1 
>>>>>> or length == 0......
>>>>>>   Or, is it that I have to construct a class of my own deriving 
>>>>>> it from SocketPort and Thread...
>>>>>> 
>>>>>> Regards,
>>>>>> Seenu.
>>>>> 
>>>>> 
>>>>> 
>>>>> 
>>>>> 
>>>> I am using TCP fo communicating between Server and Client.  In 
>>>> Server, I want to read line by line that is sent by Client.  I am 
>>>> using Readline() function in Socket class.  I want to check error, 
>>>> but I dont want to use exceptions.  After Readline, gcount() 
>>>> alwaysreturn the length read or 0.  If my client gets ^C, then at 
>>>> server gcount() returns me 0 (normally recv returns 0 but on other 
>>>> conditions -1, but gcount() always retuns +ve or 0)..  Due to this, 
>>>> my check is failing, what should I do for that????
>>>> 
>>>> Regards,
>>>> Seenu.
>>> 
>>> 
>>> 
Where can I get details about getline ???

Regards,
Seenu.

-- 
-----------------------------------------------------------------------------
If not here, you can reach me at seenutn@seenutn.org

C-DOT, 71/1, Sneha Complex, Miller Road, Bangalore - 560 052
Ph: 226 3399 Ext: 268  Direct: 238 3951 (Off)
    363 1707 (Resi)



From ulrich.merkel@osp-dd.de Tue Jun 05 05:21:54 2001
Received: from [193.99.117.146] (helo=osp-dd.de)
	by fencepost.gnu.org with esmtp (Exim 3.16 #1 (Debian))
	id 157D29-0007W1-00
	for <bug-commoncpp@gnu.org>; Tue, 05 Jun 2001 05:21:53 -0400
Received: from osp-dd.de (merkel.osp-dd.de [172.29.1.140])
	by osp-dd.de (8.8.8/8.8.8) with ESMTP id KAA05082
	for <bug-commoncpp@gnu.org>; Tue, 5 Jun 2001 10:24:27 +0200
Message-ID: <3B1CA5BD.721A475E@osp-dd.de>
Date: Tue, 05 Jun 2001 11:26:21 +0200
From: OSP Dresden <ulrich.merkel@osp-dd.de>
X-Mailer: Mozilla 4.74 [de] (X11; U; Linux 2.2.16 i686)
X-Accept-Language: en
MIME-Version: 1.0
To: "bug-commoncpp@gnu.org" <bug-commoncpp@gnu.org>
Subject: CommonC++-1.4.2 engine.cpp
Content-Type: multipart/mixed;
 boundary="------------D9FEA6552407565FA647CA9A"
Sender: bug-commoncpp-admin@gnu.org
Errors-To: bug-commoncpp-admin@gnu.org
X-BeenThere: bug-commoncpp@gnu.org
X-Mailman-Version: 2.0.3
Precedence: bulk
List-Help: <mailto:bug-commoncpp-request@gnu.org?subject=help>
List-Post: <mailto:bug-commoncpp@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=subscribe>
List-Id: Bug reports for Common C++ <bug-commoncpp.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=unsubscribe>
List-Archive: <http://mail.gnu.org/pipermail/bug-commoncpp/>

Dies ist eine mehrteilige Nachricht im MIME-Format.
--------------D9FEA6552407565FA647CA9A
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Hello developers,

I found a bug at 

void Engine::ReadBinary(uint8* data, uint32 size) THROWS
(Engine::Exception)
{
  ...
  // Next we have to deal such that, until we have a full output buffer,
  // (Or we run out of input)
  if (myUnderlyingStream.good())
  {
    ...	
  }
  else
  {
    // Oh dear - we ran out of input on the buffer.
    // Maybe we can still inflate some
    inflate(&myZStream,0);
    if (myZStream.avail_out == MAX_BUFFER)
    // THROW (PersistException(string("Oh dear - ran out of input")));
    THROW (Exception(string("Oh dear - ran out of input")));

  }
  ...	
} 

Change "PersistException" into "Exception"

Best wishes

U.Merkel
--------------D9FEA6552407565FA647CA9A
Content-Type: text/x-vcard; charset=us-ascii;
 name="ulrich.merkel.vcf"
Content-Description: Karte für OSP Dresden
Content-Disposition: attachment;
 filename="ulrich.merkel.vcf"
Content-Transfer-Encoding: 7bit

begin:vcard 
n:Merkel;Ulrich
x-mozilla-html:FALSE
org:MA;OSP-DRESDEN
adr:;;;;;;
version:2.1
email;internet:ulrich.merkel@osp-dd.de
x-mozilla-cpt:;7424
fn:Ulrich Merkel
end:vcard

--------------D9FEA6552407565FA647CA9A--



From dyfet@ostel.com Tue Jun 05 10:04:23 2001
Received: from [63.124.177.154] (helo=home.sys)
	by fencepost.gnu.org with smtp (Exim 3.16 #1 (Debian))
	id 157HRW-000310-00
	for <bug-commoncpp@gnu.org>; Tue, 05 Jun 2001 10:04:22 -0400
Received: from ostel.com (home.sys [172.16.1.254])
	by home.sys (Postfix) with ESMTP
	id 5AA37A0157; Tue,  5 Jun 2001 10:03:29 -0400 (EDT)
Message-ID: <3B1CE6B1.4000806@ostel.com>
Date: Tue, 05 Jun 2001 10:03:29 -0400
From: David Sugar <dyfet@ostel.com>
Organization: OST
User-Agent: Mozilla/5.0 (X11; U; Linux 2.2.16-9mdk i686; en-US; m18) Gecko/20001013
X-Accept-Language: en
MIME-Version: 1.0
To: OSP Dresden <ulrich.merkel@osp-dd.de>
Cc: "bug-commoncpp@gnu.org" <bug-commoncpp@gnu.org>
Subject: Re: CommonC++-1.4.2 engine.cpp
References: <3B1CA5BD.721A475E@osp-dd.de>
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
Sender: bug-commoncpp-admin@gnu.org
Errors-To: bug-commoncpp-admin@gnu.org
X-BeenThere: bug-commoncpp@gnu.org
X-Mailman-Version: 2.0.3
Precedence: bulk
List-Help: <mailto:bug-commoncpp-request@gnu.org?subject=help>
List-Post: <mailto:bug-commoncpp@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=subscribe>
List-Id: Bug reports for Common C++ <bug-commoncpp.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=unsubscribe>
List-Archive: <http://mail.gnu.org/pipermail/bug-commoncpp/>

Done and in cvs shortly...

OSP Dresden wrote:

> Hello developers,
> 
> I found a bug at 
> 
> void Engine::ReadBinary(uint8* data, uint32 size) THROWS
> (Engine::Exception)
> {
>   ...
>   // Next we have to deal such that, until we have a full output buffer,
>   // (Or we run out of input)
>   if (myUnderlyingStream.good())
>   {
>     ...	
>   }
>   else
>   {
>     // Oh dear - we ran out of input on the buffer.
>     // Maybe we can still inflate some
>     inflate(&myZStream,0);
>     if (myZStream.avail_out == MAX_BUFFER)
>     // THROW (PersistException(string("Oh dear - ran out of input")));
>     THROW (Exception(string("Oh dear - ran out of input")));
> 
>   }
>   ...	
> } 
> 
> Change "PersistException" into "Exception"
> 
> Best wishes
> 
> U.Merkel



From seenutn@cdotb.ernet.in Thu Jun 07 06:54:12 2001
Received: from [202.41.72.121] (helo=ws9.cdotb.ernet.in)
	by fencepost.gnu.org with esmtp (Exim 3.16 #1 (Debian))
	id 157xQW-0006Jg-00
	for <bug-commoncpp@gnu.org>; Thu, 07 Jun 2001 06:54:10 -0400
Received: from ws9.cdotb.ernet.in (IDENT:seenutn@[192.168.51.218])
	by ws9.cdotb.ernet.in (8.9.3/8.9.3) with ESMTP id QAA31272
	for <bug-commoncpp@gnu.org>; Thu, 7 Jun 2001 16:14:10 +0500 (GMT+0500)
Message-ID: <3B1F5E68.10204@ws9.cdotb.ernet.in>
Date: Thu, 07 Jun 2001 16:28:48 +0530
From: "Srinivasa T.N." <seenutn@cdotb.ernet.in>
Organization: C-DOT
User-Agent: Mozilla/5.0 (X11; U; Linux 2.2.14-5.0 i686; en-US; m18) Gecko/20010131 Netscape6/6.01
X-Accept-Language: en
MIME-Version: 1.0
To: bug-commoncpp <bug-commoncpp@gnu.org>
Subject: Binding a UDP Socket
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
Sender: bug-commoncpp-admin@gnu.org
Errors-To: bug-commoncpp-admin@gnu.org
X-BeenThere: bug-commoncpp@gnu.org
X-Mailman-Version: 2.0.5
Precedence: bulk
List-Help: <mailto:bug-commoncpp-request@gnu.org?subject=help>
List-Post: <mailto:bug-commoncpp@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=subscribe>
List-Id: Bug reports for Common C++ <bug-commoncpp.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=unsubscribe>
List-Archive: <http://mail.gnu.org/pipermail/bug-commoncpp/>

Hi All,
   I am a little bit novice in this matter.  In C, you can create a UDP 
socket and bind so that it can accpt from any interface (i.e., 
serv_addr.sin_addr.s_addr = htonl(INADDR_ANY) ).  Now, I want to achieve 
the same thing in Common C++..???

Regards,
Seenu.

-- 
-----------------------------------------------------------------------------
If not here, you can reach me at seenutn@seenutn.org

C-DOT, 71/1, Sneha Complex, Miller Road, Bangalore - 560 052
Ph: 226 3399 Ext: 268  Direct: 238 3951 (Off)
    363 1707 (Resi)



From seenutn@cdotb.ernet.in Fri Jun 15 02:26:39 2001
Received: from [202.41.72.121] (helo=ws9.cdotb.ernet.in)
	by fencepost.gnu.org with esmtp (Exim 3.16 #1 (Debian))
	id 15An3r-0003N9-00
	for <bug-commoncpp@gnu.org>; Fri, 15 Jun 2001 02:26:33 -0400
Received: from ws9.cdotb.ernet.in (IDENT:seenutn@[192.168.51.218])
	by ws9.cdotb.ernet.in (8.9.3/8.9.3) with ESMTP id LAA17567
	for <bug-commoncpp@gnu.org>; Fri, 15 Jun 2001 11:45:17 +0500 (GMT+0500)
Message-ID: <3B29AB55.5010406@ws9.cdotb.ernet.in>
Date: Fri, 15 Jun 2001 11:59:41 +0530
From: "Srinivasa T.N." <seenutn@cdotb.ernet.in>
Organization: C-DOT
User-Agent: Mozilla/5.0 (X11; U; Linux 2.2.14-5.0 i686; en-US; m18) Gecko/20010131 Netscape6/6.01
X-Accept-Language: en
MIME-Version: 1.0
To: bug-commoncpp <bug-commoncpp@gnu.org>
Subject: Message Queues?
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
Sender: bug-commoncpp-admin@gnu.org
Errors-To: bug-commoncpp-admin@gnu.org
X-BeenThere: bug-commoncpp@gnu.org
X-Mailman-Version: 2.0.5
Precedence: bulk
List-Help: <mailto:bug-commoncpp-request@gnu.org?subject=help>
List-Post: <mailto:bug-commoncpp@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=subscribe>
List-Id: Bug reports for Common C++ <bug-commoncpp.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=unsubscribe>
List-Archive: <http://mail.gnu.org/pipermail/bug-commoncpp/>

Hi All,
   Why is "message queue" concept not there??  How can I achieve 
communication between two threads??

With Luv,
Seenu.

-- 
-----------------------------------------------------------------------------
If not here, you can reach me at seenutn@seenutn.org

C-DOT, 71/1, Sneha Complex, Miller Road, Bangalore - 560 052
Ph: 226 3399 Ext: 268  Direct: 238 3951 (Off)
    363 1707 (Resi)



From bestmegaweb@winnings.com Fri Jun 15 07:37:15 2001
Received: from 1cust120.tnt4.cph3.da.uu.net ([213.116.23.120] helo=mydomain.com)
	by fencepost.gnu.org with esmtp (Exim 3.16 #1 (Debian))
	id 15Aruc-0000sp-00; Fri, 15 Jun 2001 07:37:14 -0400
Date: Fri, 15 Jun 2001 13:41:17 +0100
From: BESTMEGAWEB <bestmegaweb@winnings.com>
To: BESTMEGAWEB 
Subject: AN INCREDIBLE EXPERIENCE !
X-RBL-Warning: (dialups.mail-abuse.org) See <URL:http://mail-abuse.org/dul/>
Message-Id: <E15Aruc-0000sp-00@fencepost.gnu.org>
Sender: bug-commoncpp-admin@gnu.org
Errors-To: bug-commoncpp-admin@gnu.org
X-BeenThere: bug-commoncpp@gnu.org
X-Mailman-Version: 2.0.5
Precedence: bulk
List-Help: <mailto:bug-commoncpp-request@gnu.org?subject=help>
List-Post: <mailto:bug-commoncpp@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=subscribe>
List-Id: Bug reports for Common C++ <bug-commoncpp.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=unsubscribe>
List-Archive: <http://mail.gnu.org/pipermail/bug-commoncpp/>

Ladies & Gentlemen,

Are you ready to the experience of a lifetime ?

As affiliates of the CIL group, we offer you to PLUGIN to the largest SEX-SERVER on the WEB, in order to get more than 3000 MegaBytes of the best and most sensational SEX on the entire Web! 

Why on earth do you think that thousands of people from 13 countries daily choose to visit 2 particular WebSites ?

Very EASY answer!

- The largest and most incredible content of LIVE SEX is offered!
- State-of-the-art LIVE SHOWS with the wildest and most horny amateurs and pornstars in the world!
- Hardcore LIVE SEX that hasnīt crossed your imagination!
- Incredible & amazing themes from soft sex to the most bizarre sex!
- Beautiful Girls & wild studs from almost every country, allowing you to watch, see & chat with awsome amateurs & pornstars who are blond, who are black, who are Scandinavian, who are Asian, who have BIG tits, who are shaved, who are pregnant who are .... you just name it !
- The best ever made SPY-CAMS, WATCH-CAMS, POOL-CAMS, SHOWER-CAMS, AMATEUR-CAMS ... etc!  
- Several high quality Interactive Cams & LIVE SEX Chat, where you are in controle !
- Much much more ... too much to mention !   

EVERYTHING is offered 100% ANONOMOUSLY & you donīt need to sign-up or have a creditcard ... How simple is that ? 

PLUGIN now to our MEGA SEX-SERVER through any of the 2 AwardWinning Sites listed below, and get instantly access to more than 3000 MegaBytes of State-of-the-art WebSex!

RIGHT HERE AT:

http://siam.to/wonderland (This Site just has EVERYTHING you can imagine) 


Or this one, if you just love true LESBIAN SEX, CHAT and MORE from Sunny Ibiza in Spain:

http://siam.to/sonice
  

Enjoy your trip to paradise!

VERY IMPORTANT: 
To get DIRECT ACCESS to the webpages in the future, ALLWAYS keep the DIALER on your desktop or elsewhere on your PC ... Its easy, small and 100% harmless.

Yours sincerely,
BESTMEGAWEB
World Affiliates of C.I.L. Group


From mpaul@gecadsoftware.com Fri Jun 15 07:45:24 2001
Received: from antares.gecadsoftware.com ([193.230.167.76])
	by fencepost.gnu.org with smtp (Exim 3.16 #1 (Debian))
	id 15As2U-0001ar-00
	for <bug-commoncpp@gnu.org>; Fri, 15 Jun 2001 07:45:23 -0400
Received: (qmail 73352 invoked from network); 15 Jun 2001 11:45:57 -0000
Received: from unknown (HELO taz.gecadsoftware.com) (193.230.245.17)
  by antares.gecadsoftware.com with SMTP; 15 Jun 2001 11:45:57 -0000
Received: from gecadsoftware.com (mpaul.gecadsoftware.com [193.230.245.152]) by taz.gecadsoftware.com with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2653.13)
	id MY8T0BVA; Fri, 15 Jun 2001 14:43:21 +0300
Message-ID: <3B29F53C.70CB0AB2@gecadsoftware.com>
Date: Fri, 15 Jun 2001 14:45:00 +0300
From: Paul Marculescu <mpaul@gecadsoftware.com>
X-Mailer: Mozilla 4.75 [en] (X11; U; Linux 2.2.17-21mdksmp i686)
X-Accept-Language: en
MIME-Version: 1.0
To: common c++ <bug-commoncpp@gnu.org>
Subject: Keydata question
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Sender: bug-commoncpp-admin@gnu.org
Errors-To: bug-commoncpp-admin@gnu.org
X-BeenThere: bug-commoncpp@gnu.org
X-Mailman-Version: 2.0.5
Precedence: bulk
List-Help: <mailto:bug-commoncpp-request@gnu.org?subject=help>
List-Post: <mailto:bug-commoncpp@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=subscribe>
List-Id: Bug reports for Common C++ <bug-commoncpp.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=unsubscribe>
List-Archive: <http://mail.gnu.org/pipermail/bug-commoncpp/>

Hello!

If I use Keydata in a deamon, to read its configuration, and I want to
register the SIGHUP signal, so the daemon gets reconfigured when it
receives this signal, how should the Keydata act when there is need to
release current configuration?

What happens with the keysym_t structures that are allocated every time
a getLast() ( for example ) is called? Where does that memory get freed,
as I cannot find any free() call for that?

Thanks.

--
Paul Marculescu



From dyfet@ostel.com Fri Jun 15 09:59:05 2001
Received: from [63.124.177.154] (helo=home.sys)
	by fencepost.gnu.org with smtp (Exim 3.16 #1 (Debian))
	id 15Au7s-0006QF-00
	for <bug-commoncpp@gnu.org>; Fri, 15 Jun 2001 09:59:05 -0400
Received: from ostel.com (home.sys [172.16.1.254])
	by home.sys (Postfix) with ESMTP
	id BFA60A0748; Fri, 15 Jun 2001 09:55:49 -0400 (EDT)
Message-ID: <3B2A13E5.7090102@ostel.com>
Date: Fri, 15 Jun 2001 09:55:49 -0400
From: David Sugar <dyfet@ostel.com>
Organization: OST
User-Agent: Mozilla/5.0 (X11; U; Linux 2.2.16-9mdk i686; en-US; m18) Gecko/20001013
X-Accept-Language: en
MIME-Version: 1.0
To: Paul Marculescu <mpaul@gecadsoftware.com>
Cc: common c++ <bug-commoncpp@gnu.org>
Subject: Re: Keydata question
References: <3B29F53C.70CB0AB2@gecadsoftware.com>
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
Sender: bug-commoncpp-admin@gnu.org
Errors-To: bug-commoncpp-admin@gnu.org
X-BeenThere: bug-commoncpp@gnu.org
X-Mailman-Version: 2.0.5
Precedence: bulk
List-Help: <mailto:bug-commoncpp-request@gnu.org?subject=help>
List-Post: <mailto:bug-commoncpp@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=subscribe>
List-Id: Bug reports for Common C++ <bug-commoncpp.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=unsubscribe>
List-Archive: <http://mail.gnu.org/pipermail/bug-commoncpp/>

Keydata is derived from a "mempager" class.  The mempager can accululate 
memory allocations thru paged blocks which are then doled out into smaller 
objects as nessisary without additional memory allocationc calls.  Mempager 
releases all allocated memory blocks when it is destroyed (or Purge is called).

To answer your question more specifically, your SIGHUP handler should 
"Purge()" the current keydata, and then "Load()" new config info, as this is 
more efficient than destroying and created a new keydata object.

Paul Marculescu wrote:

> Hello!
> 
> If I use Keydata in a deamon, to read its configuration, and I want to
> register the SIGHUP signal, so the daemon gets reconfigured when it
> receives this signal, how should the Keydata act when there is need to
> release current configuration?
> 
> What happens with the keysym_t structures that are allocated every time
> a getLast() ( for example ) is called? Where does that memory get freed,
> as I cannot find any free() call for that?
> 
> Thanks.
> 
> --
> Paul Marculescu
> 
> 
> _______________________________________________
> Bug-commoncpp mailing list
> Bug-commoncpp@gnu.org
> http://mail.gnu.org/mailman/listinfo/bug-commoncpp



From dyfet@ostel.com Fri Jun 15 10:00:32 2001
Received: from [63.124.177.154] (helo=home.sys)
	by fencepost.gnu.org with smtp (Exim 3.16 #1 (Debian))
	id 15Au9I-0006UA-00
	for <bug-commoncpp@gnu.org>; Fri, 15 Jun 2001 10:00:32 -0400
Received: from ostel.com (home.sys [172.16.1.254])
	by home.sys (Postfix) with ESMTP
	id D3424A0748; Fri, 15 Jun 2001 09:57:17 -0400 (EDT)
Message-ID: <3B2A143D.7040808@ostel.com>
Date: Fri, 15 Jun 2001 09:57:17 -0400
From: David Sugar <dyfet@ostel.com>
Organization: OST
User-Agent: Mozilla/5.0 (X11; U; Linux 2.2.16-9mdk i686; en-US; m18) Gecko/20001013
X-Accept-Language: en
MIME-Version: 1.0
To: "Srinivasa T.N." <seenutn@cdotb.ernet.in>
Cc: bug-commoncpp <bug-commoncpp@gnu.org>
Subject: Re: Message Queues?
References: <3B29AB55.5010406@ws9.cdotb.ernet.in>
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
Sender: bug-commoncpp-admin@gnu.org
Errors-To: bug-commoncpp-admin@gnu.org
X-BeenThere: bug-commoncpp@gnu.org
X-Mailman-Version: 2.0.5
Precedence: bulk
List-Help: <mailto:bug-commoncpp-request@gnu.org?subject=help>
List-Post: <mailto:bug-commoncpp@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=subscribe>
List-Id: Bug reports for Common C++ <bug-commoncpp.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=unsubscribe>
List-Archive: <http://mail.gnu.org/pipermail/bug-commoncpp/>

There is a "Buffer" class and one could use it with a semaphore lock to 
impliment a bounded queue.  If you would like to provide a more direct message 
queue implimentation for future releases, I would be very happy to add to the 
base library as well.

David

Srinivasa T.N. wrote:

> Hi All,
>   Why is "message queue" concept not there??  How can I achieve 
> communication between two threads??
> 
> With Luv,
> Seenu.



From V.Haisman@sh.cvut.cz Sat Jun 16 12:18:03 2001
Received: from service.sh.cvut.cz ([147.32.127.214])
	by fencepost.gnu.org with esmtp (Exim 3.16 #1 (Debian))
	id 15BIlu-00066u-00
	for <bug-commoncpp@gnu.org>; Sat, 16 Jun 2001 12:18:02 -0400
Received: from logout.sh.cvut.cz (logout.sh.cvut.cz [147.32.127.203])
	by service.sh.cvut.cz (8.9.3/SH) with ESMTP id UAA07159
	for <bug-commoncpp@gnu.org>; Sat, 16 Jun 2001 20:09:16 +0200
Received: from logout.sh.cvut.cz (logout.sh.cvut.cz [147.32.127.203])
	by logout.sh.cvut.cz (8.9.3/8.9.2) with ESMTP id SAA37987
	for <bug-commoncpp@gnu.org>; Sat, 16 Jun 2001 18:18:01 +0200 (CEST)
	(envelope-from wilx@logout.sh.cvut.cz)
Date: Sat, 16 Jun 2001 18:18:00 +0200 (CEST)
From: Vaclav Haisman <V.Haisman@sh.cvut.cz>
To: bug-commoncpp@gnu.org
Subject: CommonC++ at SourceForge.net
Message-ID: <Pine.BSF.4.05.10106161815421.14434-100000@logout.sh.cvut.cz>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
Sender: bug-commoncpp-admin@gnu.org
Errors-To: bug-commoncpp-admin@gnu.org
X-BeenThere: bug-commoncpp@gnu.org
X-Mailman-Version: 2.0.5
Precedence: bulk
List-Help: <mailto:bug-commoncpp-request@gnu.org?subject=help>
List-Post: <mailto:bug-commoncpp@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=subscribe>
List-Id: Bug reports for Common C++ <bug-commoncpp.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=unsubscribe>
List-Archive: <http://mail.gnu.org/pipermail/bug-commoncpp/>

Hi,

I have submited a patch at SourceForge.net, should I send it also to
bug-commoncpp mailing list?

Vaclav Haisman




From dyfet@ostel.com Sat Jun 16 14:53:18 2001
Received: from [63.124.177.154] (helo=home.sys)
	by fencepost.gnu.org with smtp (Exim 3.16 #1 (Debian))
	id 15BLC9-0001Qz-00
	for <bug-commoncpp@gnu.org>; Sat, 16 Jun 2001 14:53:18 -0400
Received: from ostel.com (home.sys [172.16.1.254])
	by home.sys (Postfix) with ESMTP
	id EF4E5A07BC; Sat, 16 Jun 2001 14:50:12 -0400 (EDT)
Message-ID: <3B2BAA64.9040809@ostel.com>
Date: Sat, 16 Jun 2001 14:50:12 -0400
From: David Sugar <dyfet@ostel.com>
Organization: OST
User-Agent: Mozilla/5.0 (X11; U; Linux 2.2.16-9mdk i686; en-US; m18) Gecko/20001013
X-Accept-Language: en
MIME-Version: 1.0
To: Vaclav Haisman <V.Haisman@sh.cvut.cz>
Cc: bug-commoncpp@gnu.org
Subject: Re: CommonC++ at SourceForge.net
References: <Pine.BSF.4.05.10106161815421.14434-100000@logout.sh.cvut.cz>
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
Sender: bug-commoncpp-admin@gnu.org
Errors-To: bug-commoncpp-admin@gnu.org
X-BeenThere: bug-commoncpp@gnu.org
X-Mailman-Version: 2.0.5
Precedence: bulk
List-Help: <mailto:bug-commoncpp-request@gnu.org?subject=help>
List-Post: <mailto:bug-commoncpp@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=subscribe>
List-Id: Bug reports for Common C++ <bug-commoncpp.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=unsubscribe>
List-Archive: <http://mail.gnu.org/pipermail/bug-commoncpp/>

I see your patch, interesting.  I was not aware of that limitation on the 
older FreeBSD.  If it gets on sourceforge it will eventually get to where 
people can see it.  It would be nice to see savanah used for some of these 
things though...

Vaclav Haisman wrote:

> Hi,
> 
> I have submited a patch at SourceForge.net, should I send it also to
> bug-commoncpp mailing list?
> 
> Vaclav Haisman
> 
> 
> 
> _______________________________________________
> Bug-commoncpp mailing list
> Bug-commoncpp@gnu.org
> http://mail.gnu.org/mailman/listinfo/bug-commoncpp



From ianc@band-x.net Fri Jun 22 01:27:02 2001
Received: from vector.band-x.net ([213.166.0.219])
	by fencepost.gnu.org with esmtp (Exim 3.16 #1 (Debian))
	id 15DBkN-0004yL-00
	for <bug-commoncpp@gnu.org>; Thu, 21 Jun 2001 17:12:15 -0400
Received: (qmail 29363 invoked by uid 1006); 21 Jun 2001 21:12:00 -0000
Received: from ianc@band-x.net by pop3 with qmail-scanner-0.94 (uvscan: v4.0.70/v4122. . Clean. Processed in 0.103371 secs); 21/06/2001 22:12:00
Received: from unknown (HELO routing-resource.band-x.net) ([213.166.3.43]) (envelope-sender <ianc@band-x.net>)
          by vector.band-x.net (qmail-ldap-1.03) with SMTP
          for <bug-commoncpp@gnu.org>; 21 Jun 2001 21:12:00 -0000
Date: Thu, 21 Jun 2001 22:09:55 +0100 (BST)
From: Ian Campbell <ianc@band-x.net>
To:  <bug-commoncpp@gnu.org>
Subject: Problems with Linux CommonC++ Thread Class scheduling
Message-ID: <Pine.LNX.4.33.0106212158310.22609-100000@routing-resource.band-x.net>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
Sender: bug-commoncpp-admin@gnu.org
Errors-To: bug-commoncpp-admin@gnu.org
X-BeenThere: bug-commoncpp@gnu.org
X-Mailman-Version: 2.0.5
Precedence: bulk
List-Help: <mailto:bug-commoncpp-request@gnu.org?subject=help>
List-Post: <mailto:bug-commoncpp@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=subscribe>
List-Id: Bug reports for Common C++ <bug-commoncpp.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=unsubscribe>
List-Archive: <http://mail.gnu.org/pipermail/bug-commoncpp/>

Hello All,
        I have been experimenting with the CommonC++ Thread class on Linux
using the realtime pthread scheduler (either SCHED_RR or SCHED_FIFO) and
found it doesn't work properly in the 1.4.3 release. This fault means that
you can't give seperate threads a different priority from the creating
main process. This is caused by a call to pthread_attr_setinheritsched()
which according to the man page means that the priority and policy for
thread scheduler must be inherited from the creating thread. As such any
subsequent calls to pthread_attr_setschedpolicy() and
pthread_attr_setschedparam() will have no effect. Anyway the patch at the
end of this email should fixeth the problem.

Cheers,

Ian Campbell
Band-X
t: +44 (0) 207 932 8846
f: +44 (0) 207 932 8800
e: ianc@band-x.net

diff -u -r CommonC++-1.4.3/posix/thread.cpp
CommonC++-1.4.3-sched.patch/posix/thread.cpp
--- CommonC++-1.4.3/posix/thread.cpp	Thu May 31 08:30:51 2001
+++ CommonC++-1.4.3-sched.patch/posix/thread.cpp	Thu Jun 21
12:41:08 2001
@@ -1,23 +1,23 @@
 // Copyright (C) 1999-2001 Open Source Telecom Corporation.
-//
+//
 // This program is free software; you can redistribute it and/or modify
 // it under the terms of the GNU General Public License as published by
 // the Free Software Foundation; either version 2 of the License, or
 // (at your option) any later version.
-//
+//
 // This program is distributed in the hope that it will be useful,
 // but WITHOUT ANY WARRANTY; without even the implied warranty of
 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 // GNU General Public License for more details.
-//
+//
 // You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
+// along with this program; if not, write to the Free Software
 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
USA.
-//
-// As a special exception to the GNU General Public License, permission
is
-// granted for additional uses of the text contained in its release
+//
+// As a special exception to the GNU General Public License, permission
is
+// granted for additional uses of the text contained in its release
 // of Common C++.
-//
+//
 // The exception is that, if you link the Common C++ library with other
 // files to produce an executable, this does not by itself cause the
 // resulting executable to be covered by the GNU General Public License.
@@ -27,16 +27,16 @@
 // This exception does not however invalidate any other reasons why
 // the executable file might be covered by the GNU General Public
License.
 //
-// This exception applies only to the code released under the
+// This exception applies only to the code released under the
 // name Common C++.  If you copy code from other releases into a copy of
 // Common C++, as the General Public License permits, the exception does
 // not apply to the code that you add in this way.  To avoid misleading
 // anyone as to the status of such modified files, you must delete
 // this exception notice from them.
-//
+//
 // If you write modifications of your own for Common C++, it is your
choice
 // whether to permit this exception to apply to your modifications.
-// If you do not wish that, delete this exception notice.
+// If you do not wish that, delete this exception notice.

 #include "config.h"
 #include "macros.h"
@@ -137,7 +137,7 @@
 		sigaction(SIGPOLL, &act, NULL);
 #else
 		sigaction(SIGIO, &act, NULL);
-#endif
+#endif

 #ifndef	_SIG_THREAD_STOPCONT
 #ifndef	_THR_SUNOS5
@@ -161,11 +161,11 @@
 		sigaddset(&act.sa_mask, SIGPIPE);

 		sigaction(_SIG_THREAD_CANCEL, &act, NULL);
-#endif
+#endif
 		_main = this;
     	}
 	_self.setKey(this);
-}
+}

 Thread::Thread(Semaphore *start, int pri, size_t stack)
 {
@@ -176,7 +176,7 @@

 	pthread_attr_init(&_attr);
 	pthread_attr_setdetachstate(&_attr, PTHREAD_CREATE_JOINABLE);
-	pthread_attr_setinheritsched(&_attr, PTHREAD_INHERIT_SCHED);
+

 #ifdef	PTHREAD_STACK_MIN
 	if(pthread_attr_setstacksize(&_attr, stack <= PTHREAD_STACK_MIN ?
PTHREAD_STACK_MIN : stack))
@@ -192,7 +192,7 @@
 #endif

 #ifndef	__FreeBSD__
-#ifdef	_POSIX_THREAD_PRIORITY_SCHEDULING
+#ifdef	_POSIX_THREAD_PRIORITY_SCHEDULING
 	if(pri)
 	{
 		struct sched_param sched;
@@ -220,8 +220,9 @@
 			pri = sched_get_priority_min(policy);

 		sched.sched_priority = pri;
+		pthread_attr_setschedpolicy(&_attr, policy);
 		pthread_attr_setschedparam(&_attr, &sched);
-	}
+	}
 #endif
 #endif

@@ -289,7 +290,7 @@
 	{
 		pthread_detach(_tid);
 		if(_start)
-		{
+		{
 			_start->Post();
 			return 0;
 		}
@@ -351,7 +352,7 @@
 			Thread::_timer->OnTimer();
 		}
 		else
-#endif
+#endif
 		    if(th)
 			th->OnTimer();
 		break;
@@ -386,7 +387,7 @@

 	if(!setjmp(th->_env))
 	{
-		th->Initial();
+		th->Initial();
 		if(th->getCancel() == THREAD_CANCEL_INITIAL)
 			th->setCancel(THREAD_CANCEL_DEFAULT);

@@ -411,7 +412,7 @@

 #ifdef	HAVE_SETITIMER
 	struct itimerval itimer;
-
+
 	memset(&itimer, 0, sizeof(itimer));
 	itimer.it_value.tv_usec = (timer * 1000) % 1000000;
 	itimer.it_value.tv_sec = timer / 1000;
@@ -419,7 +420,7 @@
 	timer /= 1000;
 #endif

-#ifndef	_SIG_THREAD_ALARM
+#ifndef	_SIG_THREAD_ALARM
 	_arm;
 	_timer = this;
 #endif
@@ -432,7 +433,7 @@
 #else
 	alarm(timer);
 #endif
-}
+}

 timeout_t Thread::getTimer(void)
 {
@@ -491,7 +492,7 @@
 #else
 	sigwait(&mask, &signo);
 #endif
-}
+}

 void	Thread::setSuspend(thread_suspend_t mode)
 {
@@ -518,7 +519,7 @@

 	sigemptyset(&mask);
 	sigaddset(&mask, _SIG_THREAD_CANCEL);
-
+
 	switch(mode)
 	{
 	case THREAD_CANCEL_IMMEDIATE:
@@ -545,7 +546,7 @@
 		pthread_sigmask(SIG_UNBLOCK, &sigs, NULL);
 	else
 		pthread_sigmask(SIG_BLOCK, &sigs, NULL);
-}
+}

 void	Thread::setCancel(thread_cancel_t mode)
 {
@@ -580,7 +581,7 @@
 	sigemptyset(&cancel);
 	sigaddset(&cancel, _SIG_THREAD_CANCEL);

-	if(_cancel != THREAD_CANCEL_DISABLED &&
+	if(_cancel != THREAD_CANCEL_DISABLED &&
 	   _cancel != THREAD_CANCEL_INITIAL)
 		pthread_sigmask(SIG_UNBLOCK, &cancel, &old);
 #else
@@ -600,28 +601,28 @@
 {
 #ifdef  _SIG_THREAD_CANCEL
         sigset_t cancel, old;
-
+
         sigemptyset(&cancel);
         sigaddset(&cancel, _SIG_THREAD_CANCEL);
-
+
         if(_cancel != THREAD_CANCEL_DISABLED &&
            _cancel != THREAD_CANCEL_INITIAL)
                 pthread_sigmask(SIG_UNBLOCK, &cancel, &old);
 #else
         pthread_testcancel();
 #endif
-
+
 #ifdef  _SIG_THREAD_CANCEL
         if(_cancel != THREAD_CANCEL_DISABLED)
                 pthread_sigmask(SIG_SETMASK, &old, NULL);
 #endif
-}
+}


 void siginstall(int signo)
 {
 	struct sigaction act;
-
+
 	act.sa_handler = (signalexec_t)&sigHandler;
 	sigemptyset(&act.sa_mask);





From dyfet@ostel.com Fri Jun 22 10:07:23 2001
Received: from [63.124.177.154] (helo=home.sys)
	by fencepost.gnu.org with smtp (Exim 3.16 #1 (Debian))
	id 15DRaj-0001DF-00
	for <bug-commoncpp@gnu.org>; Fri, 22 Jun 2001 10:07:21 -0400
Received: from ostel.com (home.sys [172.16.1.254])
	by home.sys (Postfix) with ESMTP
	id 12D89A090A; Fri, 22 Jun 2001 10:04:58 -0400 (EDT)
Message-ID: <3B33508A.6080206@ostel.com>
Date: Fri, 22 Jun 2001 10:04:58 -0400
From: David Sugar <dyfet@ostel.com>
Organization: OST
User-Agent: Mozilla/5.0 (X11; U; Linux 2.2.16-9mdk i686; en-US; m18) Gecko/20001013
X-Accept-Language: en
MIME-Version: 1.0
To: Ian Campbell <ianc@band-x.net>
Cc: bug-commoncpp@gnu.org
Subject: Re: Problems with Linux CommonC++ Thread Class scheduling
References: <Pine.LNX.4.33.0106212158310.22609-100000@routing-resource.band-x.net>
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
Sender: bug-commoncpp-admin@gnu.org
Errors-To: bug-commoncpp-admin@gnu.org
X-BeenThere: bug-commoncpp@gnu.org
X-Mailman-Version: 2.0.5
Precedence: bulk
List-Help: <mailto:bug-commoncpp-request@gnu.org?subject=help>
List-Post: <mailto:bug-commoncpp@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=subscribe>
List-Id: Bug reports for Common C++ <bug-commoncpp.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=unsubscribe>
List-Archive: <http://mail.gnu.org/pipermail/bug-commoncpp/>

So all you are doing then is killing the line with the set inherit?

Ian Campbell wrote:

> Hello All,
>         I have been experimenting with the CommonC++ Thread class on Linux
> using the realtime pthread scheduler (either SCHED_RR or SCHED_FIFO) and
> found it doesn't work properly in the 1.4.3 release. This fault means that
> you can't give seperate threads a different priority from the creating
> main process. This is caused by a call to pthread_attr_setinheritsched()
> which according to the man page means that the priority and policy for
> thread scheduler must be inherited from the creating thread. As such any
> subsequent calls to pthread_attr_setschedpolicy() and
> pthread_attr_setschedparam() will have no effect. Anyway the patch at the
> end of this email should fixeth the problem.
> 
> Cheers,
> 
> Ian Campbell
> Band-X
> t: +44 (0) 207 932 8846
> f: +44 (0) 207 932 8800
> e: ianc@band-x.net
> 
> diff -u -r CommonC++-1.4.3/posix/thread.cpp
> CommonC++-1.4.3-sched.patch/posix/thread.cpp
> --- CommonC++-1.4.3/posix/thread.cpp	Thu May 31 08:30:51 2001
> +++ CommonC++-1.4.3-sched.patch/posix/thread.cpp	Thu Jun 21
> 12:41:08 2001
> @@ -1,23 +1,23 @@
>  // Copyright (C) 1999-2001 Open Source Telecom Corporation.
> -//
> +//
>  // This program is free software; you can redistribute it and/or modify
>  // it under the terms of the GNU General Public License as published by
>  // the Free Software Foundation; either version 2 of the License, or
>  // (at your option) any later version.
> -//
> +//
>  // This program is distributed in the hope that it will be useful,
>  // but WITHOUT ANY WARRANTY; without even the implied warranty of
>  // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
>  // GNU General Public License for more details.
> -//
> +//
>  // You should have received a copy of the GNU General Public License
> -// along with this program; if not, write to the Free Software
> +// along with this program; if not, write to the Free Software
>  // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
> USA.
> -//
> -// As a special exception to the GNU General Public License, permission
> is
> -// granted for additional uses of the text contained in its release
> +//
> +// As a special exception to the GNU General Public License, permission
> is
> +// granted for additional uses of the text contained in its release
>  // of Common C++.
> -//
> +//
>  // The exception is that, if you link the Common C++ library with other
>  // files to produce an executable, this does not by itself cause the
>  // resulting executable to be covered by the GNU General Public License.
> @@ -27,16 +27,16 @@
>  // This exception does not however invalidate any other reasons why
>  // the executable file might be covered by the GNU General Public
> License.
>  //
> -// This exception applies only to the code released under the
> +// This exception applies only to the code released under the
>  // name Common C++.  If you copy code from other releases into a copy of
>  // Common C++, as the General Public License permits, the exception does
>  // not apply to the code that you add in this way.  To avoid misleading
>  // anyone as to the status of such modified files, you must delete
>  // this exception notice from them.
> -//
> +//
>  // If you write modifications of your own for Common C++, it is your
> choice
>  // whether to permit this exception to apply to your modifications.
> -// If you do not wish that, delete this exception notice.
> +// If you do not wish that, delete this exception notice.
> 
>  #include "config.h"
>  #include "macros.h"
> @@ -137,7 +137,7 @@
>  		sigaction(SIGPOLL, &act, NULL);
>  #else
>  		sigaction(SIGIO, &act, NULL);
> -#endif
> +#endif
> 
>  #ifndef	_SIG_THREAD_STOPCONT
>  #ifndef	_THR_SUNOS5
> @@ -161,11 +161,11 @@
>  		sigaddset(&act.sa_mask, SIGPIPE);
> 
>  		sigaction(_SIG_THREAD_CANCEL, &act, NULL);
> -#endif
> +#endif
>  		_main = this;
>      	}
>  	_self.setKey(this);
> -}
> +}
> 
>  Thread::Thread(Semaphore *start, int pri, size_t stack)
>  {
> @@ -176,7 +176,7 @@
> 
>  	pthread_attr_init(&_attr);
>  	pthread_attr_setdetachstate(&_attr, PTHREAD_CREATE_JOINABLE);
> -	pthread_attr_setinheritsched(&_attr, PTHREAD_INHERIT_SCHED);
> +
> 
>  #ifdef	PTHREAD_STACK_MIN
>  	if(pthread_attr_setstacksize(&_attr, stack <= PTHREAD_STACK_MIN ?
> PTHREAD_STACK_MIN : stack))
> @@ -192,7 +192,7 @@
>  #endif
> 
>  #ifndef	__FreeBSD__
> -#ifdef	_POSIX_THREAD_PRIORITY_SCHEDULING
> +#ifdef	_POSIX_THREAD_PRIORITY_SCHEDULING
>  	if(pri)
>  	{
>  		struct sched_param sched;
> @@ -220,8 +220,9 @@
>  			pri = sched_get_priority_min(policy);
> 
>  		sched.sched_priority = pri;
> +		pthread_attr_setschedpolicy(&_attr, policy);
>  		pthread_attr_setschedparam(&_attr, &sched);
> -	}
> +	}
>  #endif
>  #endif
> 
> @@ -289,7 +290,7 @@
>  	{
>  		pthread_detach(_tid);
>  		if(_start)
> -		{
> +		{
>  			_start->Post();
>  			return 0;
>  		}
> @@ -351,7 +352,7 @@
>  			Thread::_timer->OnTimer();
>  		}
>  		else
> -#endif
> +#endif
>  		    if(th)
>  			th->OnTimer();
>  		break;
> @@ -386,7 +387,7 @@
> 
>  	if(!setjmp(th->_env))
>  	{
> -		th->Initial();
> +		th->Initial();
>  		if(th->getCancel() == THREAD_CANCEL_INITIAL)
>  			th->setCancel(THREAD_CANCEL_DEFAULT);
> 
> @@ -411,7 +412,7 @@
> 
>  #ifdef	HAVE_SETITIMER
>  	struct itimerval itimer;
> -
> +
>  	memset(&itimer, 0, sizeof(itimer));
>  	itimer.it_value.tv_usec = (timer * 1000) % 1000000;
>  	itimer.it_value.tv_sec = timer / 1000;
> @@ -419,7 +420,7 @@
>  	timer /= 1000;
>  #endif
> 
> -#ifndef	_SIG_THREAD_ALARM
> +#ifndef	_SIG_THREAD_ALARM
>  	_arm;
>  	_timer = this;
>  #endif
> @@ -432,7 +433,7 @@
>  #else
>  	alarm(timer);
>  #endif
> -}
> +}
> 
>  timeout_t Thread::getTimer(void)
>  {
> @@ -491,7 +492,7 @@
>  #else
>  	sigwait(&mask, &signo);
>  #endif
> -}
> +}
> 
>  void	Thread::setSuspend(thread_suspend_t mode)
>  {
> @@ -518,7 +519,7 @@
> 
>  	sigemptyset(&mask);
>  	sigaddset(&mask, _SIG_THREAD_CANCEL);
> -
> +
>  	switch(mode)
>  	{
>  	case THREAD_CANCEL_IMMEDIATE:
> @@ -545,7 +546,7 @@
>  		pthread_sigmask(SIG_UNBLOCK, &sigs, NULL);
>  	else
>  		pthread_sigmask(SIG_BLOCK, &sigs, NULL);
> -}
> +}
> 
>  void	Thread::setCancel(thread_cancel_t mode)
>  {
> @@ -580,7 +581,7 @@
>  	sigemptyset(&cancel);
>  	sigaddset(&cancel, _SIG_THREAD_CANCEL);
> 
> -	if(_cancel != THREAD_CANCEL_DISABLED &&
> +	if(_cancel != THREAD_CANCEL_DISABLED &&
>  	   _cancel != THREAD_CANCEL_INITIAL)
>  		pthread_sigmask(SIG_UNBLOCK, &cancel, &old);
>  #else
> @@ -600,28 +601,28 @@
>  {
>  #ifdef  _SIG_THREAD_CANCEL
>          sigset_t cancel, old;
> -
> +
>          sigemptyset(&cancel);
>          sigaddset(&cancel, _SIG_THREAD_CANCEL);
> -
> +
>          if(_cancel != THREAD_CANCEL_DISABLED &&
>             _cancel != THREAD_CANCEL_INITIAL)
>                  pthread_sigmask(SIG_UNBLOCK, &cancel, &old);
>  #else
>          pthread_testcancel();
>  #endif
> -
> +
>  #ifdef  _SIG_THREAD_CANCEL
>          if(_cancel != THREAD_CANCEL_DISABLED)
>                  pthread_sigmask(SIG_SETMASK, &old, NULL);
>  #endif
> -}
> +}
> 
> 
>  void siginstall(int signo)
>  {
>  	struct sigaction act;
> -
> +
>  	act.sa_handler = (signalexec_t)&sigHandler;
>  	sigemptyset(&act.sa_mask);
> 
> 
> 
> 
> _______________________________________________
> Bug-commoncpp mailing list
> Bug-commoncpp@gnu.org
> http://mail.gnu.org/mailman/listinfo/bug-commoncpp



From dyfet@ostel.com Fri Jun 22 10:13:30 2001
Received: from [63.124.177.154] (helo=home.sys)
	by fencepost.gnu.org with smtp (Exim 3.16 #1 (Debian))
	id 15DRge-0001Zy-00
	for <bug-commoncpp@gnu.org>; Fri, 22 Jun 2001 10:13:29 -0400
Received: from ostel.com (home.sys [172.16.1.254])
	by home.sys (Postfix) with ESMTP
	id F0AF1A090E; Fri, 22 Jun 2001 10:11:10 -0400 (EDT)
Message-ID: <3B3351FE.1050308@ostel.com>
Date: Fri, 22 Jun 2001 10:11:10 -0400
From: David Sugar <dyfet@ostel.com>
Organization: OST
User-Agent: Mozilla/5.0 (X11; U; Linux 2.2.16-9mdk i686; en-US; m18) Gecko/20001013
X-Accept-Language: en
MIME-Version: 1.0
To: Ian Campbell <ianc@band-x.net>
Cc: bug-commoncpp@gnu.org
Subject: Re: Problems with Linux CommonC++ Thread Class scheduling
References: <Pine.LNX.4.33.0106212158310.22609-100000@routing-resource.band-x.net>
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
Sender: bug-commoncpp-admin@gnu.org
Errors-To: bug-commoncpp-admin@gnu.org
X-BeenThere: bug-commoncpp@gnu.org
X-Mailman-Version: 2.0.5
Precedence: bulk
List-Help: <mailto:bug-commoncpp-request@gnu.org?subject=help>
List-Post: <mailto:bug-commoncpp@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=subscribe>
List-Id: Bug reports for Common C++ <bug-commoncpp.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=unsubscribe>
List-Archive: <http://mail.gnu.org/pipermail/bug-commoncpp/>

I have thought about this more, and I think the most correct solution is that 
the setinherit should be called, but only when pri = 0, which indicates you do 
want it scheduled the same as the parent, or in systems which do not allow 
setting and changing of scheduler priorities anyway.  So I will do a more 
specific implimentation of this.

David

Ian Campbell wrote:

> Hello All,
>         I have been experimenting with the CommonC++ Thread class on Linux
> using the realtime pthread scheduler (either SCHED_RR or SCHED_FIFO) and
> found it doesn't work properly in the 1.4.3 release. This fault means that
> you can't give seperate threads a different priority from the creating
> main process. This is caused by a call to pthread_attr_setinheritsched()
> which according to the man page means that the priority and policy for
> thread scheduler must be inherited from the creating thread. As such any
> subsequent calls to pthread_attr_setschedpolicy() and
> pthread_attr_setschedparam() will have no effect. Anyway the patch at the
> end of this email should fixeth the problem.
> 
> Cheers,
> 
> Ian Campbell
> Band-X
> t: +44 (0) 207 932 8846
> f: +44 (0) 207 932 8800
> e: ianc@band-x.net
> 
> diff -u -r CommonC++-1.4.3/posix/thread.cpp
> CommonC++-1.4.3-sched.patch/posix/thread.cpp
> --- CommonC++-1.4.3/posix/thread.cpp	Thu May 31 08:30:51 2001
> +++ CommonC++-1.4.3-sched.patch/posix/thread.cpp	Thu Jun 21
> 12:41:08 2001
> @@ -1,23 +1,23 @@
>  // Copyright (C) 1999-2001 Open Source Telecom Corporation.
> -//
> +//
>  // This program is free software; you can redistribute it and/or modify
>  // it under the terms of the GNU General Public License as published by
>  // the Free Software Foundation; either version 2 of the License, or
>  // (at your option) any later version.
> -//
> +//
>  // This program is distributed in the hope that it will be useful,
>  // but WITHOUT ANY WARRANTY; without even the implied warranty of
>  // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
>  // GNU General Public License for more details.
> -//
> +//
>  // You should have received a copy of the GNU General Public License
> -// along with this program; if not, write to the Free Software
> +// along with this program; if not, write to the Free Software
>  // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
> USA.
> -//
> -// As a special exception to the GNU General Public License, permission
> is
> -// granted for additional uses of the text contained in its release
> +//
> +// As a special exception to the GNU General Public License, permission
> is
> +// granted for additional uses of the text contained in its release
>  // of Common C++.
> -//
> +//
>  // The exception is that, if you link the Common C++ library with other
>  // files to produce an executable, this does not by itself cause the
>  // resulting executable to be covered by the GNU General Public License.
> @@ -27,16 +27,16 @@
>  // This exception does not however invalidate any other reasons why
>  // the executable file might be covered by the GNU General Public
> License.
>  //
> -// This exception applies only to the code released under the
> +// This exception applies only to the code released under the
>  // name Common C++.  If you copy code from other releases into a copy of
>  // Common C++, as the General Public License permits, the exception does
>  // not apply to the code that you add in this way.  To avoid misleading
>  // anyone as to the status of such modified files, you must delete
>  // this exception notice from them.
> -//
> +//
>  // If you write modifications of your own for Common C++, it is your
> choice
>  // whether to permit this exception to apply to your modifications.
> -// If you do not wish that, delete this exception notice.
> +// If you do not wish that, delete this exception notice.
> 
>  #include "config.h"
>  #include "macros.h"
> @@ -137,7 +137,7 @@
>  		sigaction(SIGPOLL, &act, NULL);
>  #else
>  		sigaction(SIGIO, &act, NULL);
> -#endif
> +#endif
> 
>  #ifndef	_SIG_THREAD_STOPCONT
>  #ifndef	_THR_SUNOS5
> @@ -161,11 +161,11 @@
>  		sigaddset(&act.sa_mask, SIGPIPE);
> 
>  		sigaction(_SIG_THREAD_CANCEL, &act, NULL);
> -#endif
> +#endif
>  		_main = this;
>      	}
>  	_self.setKey(this);
> -}
> +}
> 
>  Thread::Thread(Semaphore *start, int pri, size_t stack)
>  {
> @@ -176,7 +176,7 @@
> 
>  	pthread_attr_init(&_attr);
>  	pthread_attr_setdetachstate(&_attr, PTHREAD_CREATE_JOINABLE);
> -	pthread_attr_setinheritsched(&_attr, PTHREAD_INHERIT_SCHED);
> +
> 
>  #ifdef	PTHREAD_STACK_MIN
>  	if(pthread_attr_setstacksize(&_attr, stack <= PTHREAD_STACK_MIN ?
> PTHREAD_STACK_MIN : stack))
> @@ -192,7 +192,7 @@
>  #endif
> 
>  #ifndef	__FreeBSD__
> -#ifdef	_POSIX_THREAD_PRIORITY_SCHEDULING
> +#ifdef	_POSIX_THREAD_PRIORITY_SCHEDULING
>  	if(pri)
>  	{
>  		struct sched_param sched;
> @@ -220,8 +220,9 @@
>  			pri = sched_get_priority_min(policy);
> 
>  		sched.sched_priority = pri;
> +		pthread_attr_setschedpolicy(&_attr, policy);
>  		pthread_attr_setschedparam(&_attr, &sched);
> -	}
> +	}
>  #endif
>  #endif
> 
> @@ -289,7 +290,7 @@
>  	{
>  		pthread_detach(_tid);
>  		if(_start)
> -		{
> +		{
>  			_start->Post();
>  			return 0;
>  		}
> @@ -351,7 +352,7 @@
>  			Thread::_timer->OnTimer();
>  		}
>  		else
> -#endif
> +#endif
>  		    if(th)
>  			th->OnTimer();
>  		break;
> @@ -386,7 +387,7 @@
> 
>  	if(!setjmp(th->_env))
>  	{
> -		th->Initial();
> +		th->Initial();
>  		if(th->getCancel() == THREAD_CANCEL_INITIAL)
>  			th->setCancel(THREAD_CANCEL_DEFAULT);
> 
> @@ -411,7 +412,7 @@
> 
>  #ifdef	HAVE_SETITIMER
>  	struct itimerval itimer;
> -
> +
>  	memset(&itimer, 0, sizeof(itimer));
>  	itimer.it_value.tv_usec = (timer * 1000) % 1000000;
>  	itimer.it_value.tv_sec = timer / 1000;
> @@ -419,7 +420,7 @@
>  	timer /= 1000;
>  #endif
> 
> -#ifndef	_SIG_THREAD_ALARM
> +#ifndef	_SIG_THREAD_ALARM
>  	_arm;
>  	_timer = this;
>  #endif
> @@ -432,7 +433,7 @@
>  #else
>  	alarm(timer);
>  #endif
> -}
> +}
> 
>  timeout_t Thread::getTimer(void)
>  {
> @@ -491,7 +492,7 @@
>  #else
>  	sigwait(&mask, &signo);
>  #endif
> -}
> +}
> 
>  void	Thread::setSuspend(thread_suspend_t mode)
>  {
> @@ -518,7 +519,7 @@
> 
>  	sigemptyset(&mask);
>  	sigaddset(&mask, _SIG_THREAD_CANCEL);
> -
> +
>  	switch(mode)
>  	{
>  	case THREAD_CANCEL_IMMEDIATE:
> @@ -545,7 +546,7 @@
>  		pthread_sigmask(SIG_UNBLOCK, &sigs, NULL);
>  	else
>  		pthread_sigmask(SIG_BLOCK, &sigs, NULL);
> -}
> +}
> 
>  void	Thread::setCancel(thread_cancel_t mode)
>  {
> @@ -580,7 +581,7 @@
>  	sigemptyset(&cancel);
>  	sigaddset(&cancel, _SIG_THREAD_CANCEL);
> 
> -	if(_cancel != THREAD_CANCEL_DISABLED &&
> +	if(_cancel != THREAD_CANCEL_DISABLED &&
>  	   _cancel != THREAD_CANCEL_INITIAL)
>  		pthread_sigmask(SIG_UNBLOCK, &cancel, &old);
>  #else
> @@ -600,28 +601,28 @@
>  {
>  #ifdef  _SIG_THREAD_CANCEL
>          sigset_t cancel, old;
> -
> +
>          sigemptyset(&cancel);
>          sigaddset(&cancel, _SIG_THREAD_CANCEL);
> -
> +
>          if(_cancel != THREAD_CANCEL_DISABLED &&
>             _cancel != THREAD_CANCEL_INITIAL)
>                  pthread_sigmask(SIG_UNBLOCK, &cancel, &old);
>  #else
>          pthread_testcancel();
>  #endif
> -
> +
>  #ifdef  _SIG_THREAD_CANCEL
>          if(_cancel != THREAD_CANCEL_DISABLED)
>                  pthread_sigmask(SIG_SETMASK, &old, NULL);
>  #endif
> -}
> +}
> 
> 
>  void siginstall(int signo)
>  {
>  	struct sigaction act;
> -
> +
>  	act.sa_handler = (signalexec_t)&sigHandler;
>  	sigemptyset(&act.sa_mask);
> 
> 
> 
> 
> _______________________________________________
> Bug-commoncpp mailing list
> Bug-commoncpp@gnu.org
> http://mail.gnu.org/mailman/listinfo/bug-commoncpp



From ianc@band-x.net Fri Jun 22 10:17:42 2001
Received: from vector.band-x.net ([213.166.0.219])
	by fencepost.gnu.org with esmtp (Exim 3.16 #1 (Debian))
	id 15DRkk-0001ou-00
	for <bug-commoncpp@gnu.org>; Fri, 22 Jun 2001 10:17:42 -0400
Received: (qmail 11484 invoked by uid 1006); 22 Jun 2001 14:17:37 -0000
Received: from ianc@band-x.net by pop3 with qmail-scanner-0.94 (uvscan: v4.0.70/v4122. . Clean. Processed in 0.105899 secs); 22/06/2001 15:17:37
Received: from unknown (HELO routing-resource.band-x.net) ([213.166.3.43]) (envelope-sender <ianc@band-x.net>)
          by vector.band-x.net (qmail-ldap-1.03) with SMTP
          for <dyfet@ostel.com>; 22 Jun 2001 14:17:37 -0000
Date: Fri, 22 Jun 2001 15:15:29 +0100 (BST)
From: Ian Campbell <ianc@band-x.net>
To: David Sugar <dyfet@ostel.com>
cc: "bug-commoncpp@gnu.org" <bug-commoncpp@gnu.org>
Subject: Re: Problems with Linux CommonC++ Thread Class scheduling
In-Reply-To: <3B33508A.6080206@ostel.com>
Message-ID: <Pine.LNX.4.33.0106221510450.25606-100000@routing-resource.band-x.net>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
Sender: bug-commoncpp-admin@gnu.org
Errors-To: bug-commoncpp-admin@gnu.org
X-BeenThere: bug-commoncpp@gnu.org
X-Mailman-Version: 2.0.5
Precedence: bulk
List-Help: <mailto:bug-commoncpp-request@gnu.org?subject=help>
List-Post: <mailto:bug-commoncpp@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=subscribe>
List-Id: Bug reports for Common C++ <bug-commoncpp.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=unsubscribe>
List-Archive: <http://mail.gnu.org/pipermail/bug-commoncpp/>

Yes, and adding in a line that calls pthread_attr_setsched_policy() which
takes the the creating processes schedule policy and applies it to the new
thread. This effectively inherits the policy type.

Cheers,

Ian


Ian Campbell
Band-X
t: +44 (0) 207 932 8846
f: +44 (0) 207 932 8800
e: ianc@band-x.net

On Fri, 22 Jun 2001, David Sugar wrote:

> So all you are doing then is killing the line with the set inherit?
>
> Ian Campbell wrote:
>
> > Hello All,
> >         I have been experimenting with the CommonC++ Thread class on Linux
> > using the realtime pthread scheduler (either SCHED_RR or SCHED_FIFO) and
> > found it doesn't work properly in the 1.4.3 release. This fault means that
> > you can't give seperate threads a different priority from the creating
> > main process. This is caused by a call to pthread_attr_setinheritsched()
> > which according to the man page means that the priority and policy for
> > thread scheduler must be inherited from the creating thread. As such any
> > subsequent calls to pthread_attr_setschedpolicy() and
> > pthread_attr_setschedparam() will have no effect. Anyway the patch at the
> > end of this email should fixeth the problem.
> >
> > Cheers,
> >
> > Ian Campbell
> > Band-X
> > t: +44 (0) 207 932 8846
> > f: +44 (0) 207 932 8800
> > e: ianc@band-x.net
> >
> > diff -u -r CommonC++-1.4.3/posix/thread.cpp
> > CommonC++-1.4.3-sched.patch/posix/thread.cpp
> > --- CommonC++-1.4.3/posix/thread.cpp	Thu May 31 08:30:51 2001
> > +++ CommonC++-1.4.3-sched.patch/posix/thread.cpp	Thu Jun 21
> > 12:41:08 2001
> > @@ -1,23 +1,23 @@
> >  // Copyright (C) 1999-2001 Open Source Telecom Corporation.
> > -//
> > +//
> >  // This program is free software; you can redistribute it and/or modify
> >  // it under the terms of the GNU General Public License as published by
> >  // the Free Software Foundation; either version 2 of the License, or
> >  // (at your option) any later version.
> > -//
> > +//
> >  // This program is distributed in the hope that it will be useful,
> >  // but WITHOUT ANY WARRANTY; without even the implied warranty of
> >  // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> >  // GNU General Public License for more details.
> > -//
> > +//
> >  // You should have received a copy of the GNU General Public License
> > -// along with this program; if not, write to the Free Software
> > +// along with this program; if not, write to the Free Software
> >  // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
> > USA.
> > -//
> > -// As a special exception to the GNU General Public License, permission
> > is
> > -// granted for additional uses of the text contained in its release
> > +//
> > +// As a special exception to the GNU General Public License, permission
> > is
> > +// granted for additional uses of the text contained in its release
> >  // of Common C++.
> > -//
> > +//
> >  // The exception is that, if you link the Common C++ library with other
> >  // files to produce an executable, this does not by itself cause the
> >  // resulting executable to be covered by the GNU General Public License.
> > @@ -27,16 +27,16 @@
> >  // This exception does not however invalidate any other reasons why
> >  // the executable file might be covered by the GNU General Public
> > License.
> >  //
> > -// This exception applies only to the code released under the
> > +// This exception applies only to the code released under the
> >  // name Common C++.  If you copy code from other releases into a copy of
> >  // Common C++, as the General Public License permits, the exception does
> >  // not apply to the code that you add in this way.  To avoid misleading
> >  // anyone as to the status of such modified files, you must delete
> >  // this exception notice from them.
> > -//
> > +//
> >  // If you write modifications of your own for Common C++, it is your
> > choice
> >  // whether to permit this exception to apply to your modifications.
> > -// If you do not wish that, delete this exception notice.
> > +// If you do not wish that, delete this exception notice.
> >
> >  #include "config.h"
> >  #include "macros.h"
> > @@ -137,7 +137,7 @@
> >  		sigaction(SIGPOLL, &act, NULL);
> >  #else
> >  		sigaction(SIGIO, &act, NULL);
> > -#endif
> > +#endif
> >
> >  #ifndef	_SIG_THREAD_STOPCONT
> >  #ifndef	_THR_SUNOS5
> > @@ -161,11 +161,11 @@
> >  		sigaddset(&act.sa_mask, SIGPIPE);
> >
> >  		sigaction(_SIG_THREAD_CANCEL, &act, NULL);
> > -#endif
> > +#endif
> >  		_main = this;
> >      	}
> >  	_self.setKey(this);
> > -}
> > +}
> >
> >  Thread::Thread(Semaphore *start, int pri, size_t stack)
> >  {
> > @@ -176,7 +176,7 @@
> >
> >  	pthread_attr_init(&_attr);
> >  	pthread_attr_setdetachstate(&_attr, PTHREAD_CREATE_JOINABLE);
> > -	pthread_attr_setinheritsched(&_attr, PTHREAD_INHERIT_SCHED);
> > +
> >
> >  #ifdef	PTHREAD_STACK_MIN
> >  	if(pthread_attr_setstacksize(&_attr, stack <= PTHREAD_STACK_MIN ?
> > PTHREAD_STACK_MIN : stack))
> > @@ -192,7 +192,7 @@
> >  #endif
> >
> >  #ifndef	__FreeBSD__
> > -#ifdef	_POSIX_THREAD_PRIORITY_SCHEDULING
> > +#ifdef	_POSIX_THREAD_PRIORITY_SCHEDULING
> >  	if(pri)
> >  	{
> >  		struct sched_param sched;
> > @@ -220,8 +220,9 @@
> >  			pri = sched_get_priority_min(policy);
> >
> >  		sched.sched_priority = pri;
> > +		pthread_attr_setschedpolicy(&_attr, policy);
> >  		pthread_attr_setschedparam(&_attr, &sched);
> > -	}
> > +	}
> >  #endif
> >  #endif
> >
> > @@ -289,7 +290,7 @@
> >  	{
> >  		pthread_detach(_tid);
> >  		if(_start)
> > -		{
> > +		{
> >  			_start->Post();
> >  			return 0;
> >  		}
> > @@ -351,7 +352,7 @@
> >  			Thread::_timer->OnTimer();
> >  		}
> >  		else
> > -#endif
> > +#endif
> >  		    if(th)
> >  			th->OnTimer();
> >  		break;
> > @@ -386,7 +387,7 @@
> >
> >  	if(!setjmp(th->_env))
> >  	{
> > -		th->Initial();
> > +		th->Initial();
> >  		if(th->getCancel() == THREAD_CANCEL_INITIAL)
> >  			th->setCancel(THREAD_CANCEL_DEFAULT);
> >
> > @@ -411,7 +412,7 @@
> >
> >  #ifdef	HAVE_SETITIMER
> >  	struct itimerval itimer;
> > -
> > +
> >  	memset(&itimer, 0, sizeof(itimer));
> >  	itimer.it_value.tv_usec = (timer * 1000) % 1000000;
> >  	itimer.it_value.tv_sec = timer / 1000;
> > @@ -419,7 +420,7 @@
> >  	timer /= 1000;
> >  #endif
> >
> > -#ifndef	_SIG_THREAD_ALARM
> > +#ifndef	_SIG_THREAD_ALARM
> >  	_arm;
> >  	_timer = this;
> >  #endif
> > @@ -432,7 +433,7 @@
> >  #else
> >  	alarm(timer);
> >  #endif
> > -}
> > +}
> >
> >  timeout_t Thread::getTimer(void)
> >  {
> > @@ -491,7 +492,7 @@
> >  #else
> >  	sigwait(&mask, &signo);
> >  #endif
> > -}
> > +}
> >
> >  void	Thread::setSuspend(thread_suspend_t mode)
> >  {
> > @@ -518,7 +519,7 @@
> >
> >  	sigemptyset(&mask);
> >  	sigaddset(&mask, _SIG_THREAD_CANCEL);
> > -
> > +
> >  	switch(mode)
> >  	{
> >  	case THREAD_CANCEL_IMMEDIATE:
> > @@ -545,7 +546,7 @@
> >  		pthread_sigmask(SIG_UNBLOCK, &sigs, NULL);
> >  	else
> >  		pthread_sigmask(SIG_BLOCK, &sigs, NULL);
> > -}
> > +}
> >
> >  void	Thread::setCancel(thread_cancel_t mode)
> >  {
> > @@ -580,7 +581,7 @@
> >  	sigemptyset(&cancel);
> >  	sigaddset(&cancel, _SIG_THREAD_CANCEL);
> >
> > -	if(_cancel != THREAD_CANCEL_DISABLED &&
> > +	if(_cancel != THREAD_CANCEL_DISABLED &&
> >  	   _cancel != THREAD_CANCEL_INITIAL)
> >  		pthread_sigmask(SIG_UNBLOCK, &cancel, &old);
> >  #else
> > @@ -600,28 +601,28 @@
> >  {
> >  #ifdef  _SIG_THREAD_CANCEL
> >          sigset_t cancel, old;
> > -
> > +
> >          sigemptyset(&cancel);
> >          sigaddset(&cancel, _SIG_THREAD_CANCEL);
> > -
> > +
> >          if(_cancel != THREAD_CANCEL_DISABLED &&
> >             _cancel != THREAD_CANCEL_INITIAL)
> >                  pthread_sigmask(SIG_UNBLOCK, &cancel, &old);
> >  #else
> >          pthread_testcancel();
> >  #endif
> > -
> > +
> >  #ifdef  _SIG_THREAD_CANCEL
> >          if(_cancel != THREAD_CANCEL_DISABLED)
> >                  pthread_sigmask(SIG_SETMASK, &old, NULL);
> >  #endif
> > -}
> > +}
> >
> >
> >  void siginstall(int signo)
> >  {
> >  	struct sigaction act;
> > -
> > +
> >  	act.sa_handler = (signalexec_t)&sigHandler;
> >  	sigemptyset(&act.sa_mask);
> >
> >
> >
> >
> > _______________________________________________
> > Bug-commoncpp mailing list
> > Bug-commoncpp@gnu.org
> > http://mail.gnu.org/mailman/listinfo/bug-commoncpp
>
>




From ianc@band-x.net Fri Jun 22 10:39:57 2001
Received: from vector.band-x.net ([213.166.0.219])
	by fencepost.gnu.org with esmtp (Exim 3.16 #1 (Debian))
	id 15DS6G-0002Xm-00
	for <bug-commoncpp@gnu.org>; Fri, 22 Jun 2001 10:39:56 -0400
Received: (qmail 18202 invoked by uid 1006); 22 Jun 2001 14:39:55 -0000
Received: from ianc@band-x.net by pop3 with qmail-scanner-0.94 (uvscan: v4.0.70/v4122. . Clean. Processed in 0.105726 secs); 22/06/2001 15:39:55
Received: from unknown (HELO routing-resource.band-x.net) ([213.166.3.43]) (envelope-sender <ianc@band-x.net>)
          by vector.band-x.net (qmail-ldap-1.03) with SMTP
          for <dyfet@ostel.com>; 22 Jun 2001 14:39:55 -0000
Date: Fri, 22 Jun 2001 15:37:47 +0100 (BST)
From: Ian Campbell <ianc@band-x.net>
To: David Sugar <dyfet@ostel.com>
cc: "bug-commoncpp@gnu.org" <bug-commoncpp@gnu.org>
Subject: Re: Problems with Linux CommonC++ Thread Class scheduling
In-Reply-To: <3B3351FE.1050308@ostel.com>
Message-ID: <Pine.LNX.4.33.0106221526070.25606-100000@routing-resource.band-x.net>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
Sender: bug-commoncpp-admin@gnu.org
Errors-To: bug-commoncpp-admin@gnu.org
X-BeenThere: bug-commoncpp@gnu.org
X-Mailman-Version: 2.0.5
Precedence: bulk
List-Help: <mailto:bug-commoncpp-request@gnu.org?subject=help>
List-Post: <mailto:bug-commoncpp@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=subscribe>
List-Id: Bug reports for Common C++ <bug-commoncpp.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=unsubscribe>
List-Archive: <http://mail.gnu.org/pipermail/bug-commoncpp/>

The code below that gets the priority and the policy of the creating
process and uses that to create the new thread so that should be ok. Not
sure what happens in other implementations though.

Ian

Ian Campbell
Band-X
t: +44 (0) 207 932 8846
f: +44 (0) 207 932 8800
e: ianc@band-x.net

On Fri, 22 Jun 2001, David Sugar wrote:

> I have thought about this more, and I think the most correct solution is that
> the setinherit should be called, but only when pri = 0, which indicates you do
> want it scheduled the same as the parent, or in systems which do not allow
> setting and changing of scheduler priorities anyway.  So I will do a more
> specific implimentation of this.
>
> David
>
> Ian Campbell wrote:
>
> > Hello All,
> >         I have been experimenting with the CommonC++ Thread class on Linux
> > using the realtime pthread scheduler (either SCHED_RR or SCHED_FIFO) and
> > found it doesn't work properly in the 1.4.3 release. This fault means that
> > you can't give seperate threads a different priority from the creating
> > main process. This is caused by a call to pthread_attr_setinheritsched()
> > which according to the man page means that the priority and policy for
> > thread scheduler must be inherited from the creating thread. As such any
> > subsequent calls to pthread_attr_setschedpolicy() and
> > pthread_attr_setschedparam() will have no effect. Anyway the patch at the
> > end of this email should fixeth the problem.
> >
> > Cheers,
> >
> > Ian Campbell
> > Band-X
> > t: +44 (0) 207 932 8846
> > f: +44 (0) 207 932 8800
> > e: ianc@band-x.net
> >
> > diff -u -r CommonC++-1.4.3/posix/thread.cpp
> > CommonC++-1.4.3-sched.patch/posix/thread.cpp
> > --- CommonC++-1.4.3/posix/thread.cpp	Thu May 31 08:30:51 2001
> > +++ CommonC++-1.4.3-sched.patch/posix/thread.cpp	Thu Jun 21
> > 12:41:08 2001
> > @@ -1,23 +1,23 @@
> >  // Copyright (C) 1999-2001 Open Source Telecom Corporation.
> > -//
> > +//
> >  // This program is free software; you can redistribute it and/or modify
> >  // it under the terms of the GNU General Public License as published by
> >  // the Free Software Foundation; either version 2 of the License, or
> >  // (at your option) any later version.
> > -//
> > +//
> >  // This program is distributed in the hope that it will be useful,
> >  // but WITHOUT ANY WARRANTY; without even the implied warranty of
> >  // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> >  // GNU General Public License for more details.
> > -//
> > +//
> >  // You should have received a copy of the GNU General Public License
> > -// along with this program; if not, write to the Free Software
> > +// along with this program; if not, write to the Free Software
> >  // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
> > USA.
> > -//
> > -// As a special exception to the GNU General Public License, permission
> > is
> > -// granted for additional uses of the text contained in its release
> > +//
> > +// As a special exception to the GNU General Public License, permission
> > is
> > +// granted for additional uses of the text contained in its release
> >  // of Common C++.
> > -//
> > +//
> >  // The exception is that, if you link the Common C++ library with other
> >  // files to produce an executable, this does not by itself cause the
> >  // resulting executable to be covered by the GNU General Public License.
> > @@ -27,16 +27,16 @@
> >  // This exception does not however invalidate any other reasons why
> >  // the executable file might be covered by the GNU General Public
> > License.
> >  //
> > -// This exception applies only to the code released under the
> > +// This exception applies only to the code released under the
> >  // name Common C++.  If you copy code from other releases into a copy of
> >  // Common C++, as the General Public License permits, the exception does
> >  // not apply to the code that you add in this way.  To avoid misleading
> >  // anyone as to the status of such modified files, you must delete
> >  // this exception notice from them.
> > -//
> > +//
> >  // If you write modifications of your own for Common C++, it is your
> > choice
> >  // whether to permit this exception to apply to your modifications.
> > -// If you do not wish that, delete this exception notice.
> > +// If you do not wish that, delete this exception notice.
> >
> >  #include "config.h"
> >  #include "macros.h"
> > @@ -137,7 +137,7 @@
> >  		sigaction(SIGPOLL, &act, NULL);
> >  #else
> >  		sigaction(SIGIO, &act, NULL);
> > -#endif
> > +#endif
> >
> >  #ifndef	_SIG_THREAD_STOPCONT
> >  #ifndef	_THR_SUNOS5
> > @@ -161,11 +161,11 @@
> >  		sigaddset(&act.sa_mask, SIGPIPE);
> >
> >  		sigaction(_SIG_THREAD_CANCEL, &act, NULL);
> > -#endif
> > +#endif
> >  		_main = this;
> >      	}
> >  	_self.setKey(this);
> > -}
> > +}
> >
> >  Thread::Thread(Semaphore *start, int pri, size_t stack)
> >  {
> > @@ -176,7 +176,7 @@
> >
> >  	pthread_attr_init(&_attr);
> >  	pthread_attr_setdetachstate(&_attr, PTHREAD_CREATE_JOINABLE);
> > -	pthread_attr_setinheritsched(&_attr, PTHREAD_INHERIT_SCHED);
> > +
> >
> >  #ifdef	PTHREAD_STACK_MIN
> >  	if(pthread_attr_setstacksize(&_attr, stack <= PTHREAD_STACK_MIN ?
> > PTHREAD_STACK_MIN : stack))
> > @@ -192,7 +192,7 @@
> >  #endif
> >
> >  #ifndef	__FreeBSD__
> > -#ifdef	_POSIX_THREAD_PRIORITY_SCHEDULING
> > +#ifdef	_POSIX_THREAD_PRIORITY_SCHEDULING
> >  	if(pri)
> >  	{
> >  		struct sched_param sched;
> > @@ -220,8 +220,9 @@
> >  			pri = sched_get_priority_min(policy);
> >
> >  		sched.sched_priority = pri;
> > +		pthread_attr_setschedpolicy(&_attr, policy);
> >  		pthread_attr_setschedparam(&_attr, &sched);
> > -	}
> > +	}
> >  #endif
> >  #endif
> >
> > @@ -289,7 +290,7 @@
> >  	{
> >  		pthread_detach(_tid);
> >  		if(_start)
> > -		{
> > +		{
> >  			_start->Post();
> >  			return 0;
> >  		}
> > @@ -351,7 +352,7 @@
> >  			Thread::_timer->OnTimer();
> >  		}
> >  		else
> > -#endif
> > +#endif
> >  		    if(th)
> >  			th->OnTimer();
> >  		break;
> > @@ -386,7 +387,7 @@
> >
> >  	if(!setjmp(th->_env))
> >  	{
> > -		th->Initial();
> > +		th->Initial();
> >  		if(th->getCancel() == THREAD_CANCEL_INITIAL)
> >  			th->setCancel(THREAD_CANCEL_DEFAULT);
> >
> > @@ -411,7 +412,7 @@
> >
> >  #ifdef	HAVE_SETITIMER
> >  	struct itimerval itimer;
> > -
> > +
> >  	memset(&itimer, 0, sizeof(itimer));
> >  	itimer.it_value.tv_usec = (timer * 1000) % 1000000;
> >  	itimer.it_value.tv_sec = timer / 1000;
> > @@ -419,7 +420,7 @@
> >  	timer /= 1000;
> >  #endif
> >
> > -#ifndef	_SIG_THREAD_ALARM
> > +#ifndef	_SIG_THREAD_ALARM
> >  	_arm;
> >  	_timer = this;
> >  #endif
> > @@ -432,7 +433,7 @@
> >  #else
> >  	alarm(timer);
> >  #endif
> > -}
> > +}
> >
> >  timeout_t Thread::getTimer(void)
> >  {
> > @@ -491,7 +492,7 @@
> >  #else
> >  	sigwait(&mask, &signo);
> >  #endif
> > -}
> > +}
> >
> >  void	Thread::setSuspend(thread_suspend_t mode)
> >  {
> > @@ -518,7 +519,7 @@
> >
> >  	sigemptyset(&mask);
> >  	sigaddset(&mask, _SIG_THREAD_CANCEL);
> > -
> > +
> >  	switch(mode)
> >  	{
> >  	case THREAD_CANCEL_IMMEDIATE:
> > @@ -545,7 +546,7 @@
> >  		pthread_sigmask(SIG_UNBLOCK, &sigs, NULL);
> >  	else
> >  		pthread_sigmask(SIG_BLOCK, &sigs, NULL);
> > -}
> > +}
> >
> >  void	Thread::setCancel(thread_cancel_t mode)
> >  {
> > @@ -580,7 +581,7 @@
> >  	sigemptyset(&cancel);
> >  	sigaddset(&cancel, _SIG_THREAD_CANCEL);
> >
> > -	if(_cancel != THREAD_CANCEL_DISABLED &&
> > +	if(_cancel != THREAD_CANCEL_DISABLED &&
> >  	   _cancel != THREAD_CANCEL_INITIAL)
> >  		pthread_sigmask(SIG_UNBLOCK, &cancel, &old);
> >  #else
> > @@ -600,28 +601,28 @@
> >  {
> >  #ifdef  _SIG_THREAD_CANCEL
> >          sigset_t cancel, old;
> > -
> > +
> >          sigemptyset(&cancel);
> >          sigaddset(&cancel, _SIG_THREAD_CANCEL);
> > -
> > +
> >          if(_cancel != THREAD_CANCEL_DISABLED &&
> >             _cancel != THREAD_CANCEL_INITIAL)
> >                  pthread_sigmask(SIG_UNBLOCK, &cancel, &old);
> >  #else
> >          pthread_testcancel();
> >  #endif
> > -
> > +
> >  #ifdef  _SIG_THREAD_CANCEL
> >          if(_cancel != THREAD_CANCEL_DISABLED)
> >                  pthread_sigmask(SIG_SETMASK, &old, NULL);
> >  #endif
> > -}
> > +}
> >
> >
> >  void siginstall(int signo)
> >  {
> >  	struct sigaction act;
> > -
> > +
> >  	act.sa_handler = (signalexec_t)&sigHandler;
> >  	sigemptyset(&act.sa_mask);
> >
> >
> >
> >
> > _______________________________________________
> > Bug-commoncpp mailing list
> > Bug-commoncpp@gnu.org
> > http://mail.gnu.org/mailman/listinfo/bug-commoncpp
>
>



From dyfet@ostel.com Fri Jun 22 10:50:21 2001
Received: from [63.124.177.154] (helo=home.sys)
	by fencepost.gnu.org with smtp (Exim 3.16 #1 (Debian))
	id 15DSGH-00035g-00
	for <bug-commoncpp@gnu.org>; Fri, 22 Jun 2001 10:50:18 -0400
Received: from ostel.com (home.sys [172.16.1.254])
	by home.sys (Postfix) with ESMTP
	id 67565A0914; Fri, 22 Jun 2001 10:48:00 -0400 (EDT)
Message-ID: <3B335AA0.9070203@ostel.com>
Date: Fri, 22 Jun 2001 10:48:00 -0400
From: David Sugar <dyfet@ostel.com>
Organization: OST
User-Agent: Mozilla/5.0 (X11; U; Linux 2.2.16-9mdk i686; en-US; m18) Gecko/20001013
X-Accept-Language: en
MIME-Version: 1.0
To: Ian Campbell <ianc@band-x.net>
Cc: "bug-commoncpp@gnu.org" <bug-commoncpp@gnu.org>
Subject: Re: Problems with Linux CommonC++ Thread Class scheduling
References: <Pine.LNX.4.33.0106221526070.25606-100000@routing-resource.band-x.net>
Content-Type: multipart/mixed;
 boundary="------------030103040801050803090600"
Sender: bug-commoncpp-admin@gnu.org
Errors-To: bug-commoncpp-admin@gnu.org
X-BeenThere: bug-commoncpp@gnu.org
X-Mailman-Version: 2.0.5
Precedence: bulk
List-Help: <mailto:bug-commoncpp-request@gnu.org?subject=help>
List-Post: <mailto:bug-commoncpp@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=subscribe>
List-Id: Bug reports for Common C++ <bug-commoncpp.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=unsubscribe>
List-Archive: <http://mail.gnu.org/pipermail/bug-commoncpp/>

This is a multi-part message in MIME format.
--------------030103040801050803090600
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit

Okay, I have attached what I think will be the final version of this...


Ian Campbell wrote:

> The code below that gets the priority and the policy of the creating
> process and uses that to create the new thread so that should be ok. Not
> sure what happens in other implementations though.
> 
> Ian
> 
> Ian Campbell
> Band-X
> t: +44 (0) 207 932 8846
> f: +44 (0) 207 932 8800
> e: ianc@band-x.net
> 
> On Fri, 22 Jun 2001, David Sugar wrote:
> 
> 
>> I have thought about this more, and I think the most correct solution is that
>> the setinherit should be called, but only when pri = 0, which indicates you do
>> want it scheduled the same as the parent, or in systems which do not allow
>> setting and changing of scheduler priorities anyway.  So I will do a more
>> specific implimentation of this.
>> 
>> David
>> 
>> Ian Campbell wrote:
>> 
>> 
>>> Hello All,
>>>         I have been experimenting with the CommonC++ Thread class on Linux
>>> using the realtime pthread scheduler (either SCHED_RR or SCHED_FIFO) and
>>> found it doesn't work properly in the 1.4.3 release. This fault means that
>>> you can't give seperate threads a different priority from the creating
>>> main process. This is caused by a call to pthread_attr_setinheritsched()
>>> which according to the man page means that the priority and policy for
>>> thread scheduler must be inherited from the creating thread. As such any
>>> subsequent calls to pthread_attr_setschedpolicy() and
>>> pthread_attr_setschedparam() will have no effect. Anyway the patch at the
>>> end of this email should fixeth the problem.
>>> 
>>> Cheers,
>>> 
>>> Ian Campbell
>>> Band-X
>>> t: +44 (0) 207 932 8846
>>> f: +44 (0) 207 932 8800
>>> e: ianc@band-x.net
>>> 
>>> diff -u -r CommonC++-1.4.3/posix/thread.cpp
>>> CommonC++-1.4.3-sched.patch/posix/thread.cpp
>>> --- CommonC++-1.4.3/posix/thread.cpp	Thu May 31 08:30:51 2001
>>> +++ CommonC++-1.4.3-sched.patch/posix/thread.cpp	Thu Jun 21
>>> 12:41:08 2001
>>> @@ -1,23 +1,23 @@
>>>  // Copyright (C) 1999-2001 Open Source Telecom Corporation.
>>> -//
>>> +//
>>>  // This program is free software; you can redistribute it and/or modify
>>>  // it under the terms of the GNU General Public License as published by
>>>  // the Free Software Foundation; either version 2 of the License, or
>>>  // (at your option) any later version.
>>> -//
>>> +//
>>>  // This program is distributed in the hope that it will be useful,
>>>  // but WITHOUT ANY WARRANTY; without even the implied warranty of
>>>  // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
>>>  // GNU General Public License for more details.
>>> -//
>>> +//
>>>  // You should have received a copy of the GNU General Public License
>>> -// along with this program; if not, write to the Free Software
>>> +// along with this program; if not, write to the Free Software
>>>  // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
>>> USA.
>>> -//
>>> -// As a special exception to the GNU General Public License, permission
>>> is
>>> -// granted for additional uses of the text contained in its release
>>> +//
>>> +// As a special exception to the GNU General Public License, permission
>>> is
>>> +// granted for additional uses of the text contained in its release
>>>  // of Common C++.
>>> -//
>>> +//
>>>  // The exception is that, if you link the Common C++ library with other
>>>  // files to produce an executable, this does not by itself cause the
>>>  // resulting executable to be covered by the GNU General Public License.
>>> @@ -27,16 +27,16 @@
>>>  // This exception does not however invalidate any other reasons why
>>>  // the executable file might be covered by the GNU General Public
>>> License.
>>>  //
>>> -// This exception applies only to the code released under the
>>> +// This exception applies only to the code released under the
>>>  // name Common C++.  If you copy code from other releases into a copy of
>>>  // Common C++, as the General Public License permits, the exception does
>>>  // not apply to the code that you add in this way.  To avoid misleading
>>>  // anyone as to the status of such modified files, you must delete
>>>  // this exception notice from them.
>>> -//
>>> +//
>>>  // If you write modifications of your own for Common C++, it is your
>>> choice
>>>  // whether to permit this exception to apply to your modifications.
>>> -// If you do not wish that, delete this exception notice.
>>> +// If you do not wish that, delete this exception notice.
>>> 
>>>  #include "config.h"
>>>  #include "macros.h"
>>> @@ -137,7 +137,7 @@
>>>  		sigaction(SIGPOLL, &act, NULL);
>>>  #else
>>>  		sigaction(SIGIO, &act, NULL);
>>> -#endif
>>> +#endif
>>> 
>>>  #ifndef	_SIG_THREAD_STOPCONT
>>>  #ifndef	_THR_SUNOS5
>>> @@ -161,11 +161,11 @@
>>>  		sigaddset(&act.sa_mask, SIGPIPE);
>>> 
>>>  		sigaction(_SIG_THREAD_CANCEL, &act, NULL);
>>> -#endif
>>> +#endif
>>>  		_main = this;
>>>      	}
>>>  	_self.setKey(this);
>>> -}
>>> +}
>>> 
>>>  Thread::Thread(Semaphore *start, int pri, size_t stack)
>>>  {
>>> @@ -176,7 +176,7 @@
>>> 
>>>  	pthread_attr_init(&_attr);
>>>  	pthread_attr_setdetachstate(&_attr, PTHREAD_CREATE_JOINABLE);
>>> -	pthread_attr_setinheritsched(&_attr, PTHREAD_INHERIT_SCHED);
>>> +
>>> 
>>>  #ifdef	PTHREAD_STACK_MIN
>>>  	if(pthread_attr_setstacksize(&_attr, stack <= PTHREAD_STACK_MIN ?
>>> PTHREAD_STACK_MIN : stack))
>>> @@ -192,7 +192,7 @@
>>>  #endif
>>> 
>>>  #ifndef	__FreeBSD__
>>> -#ifdef	_POSIX_THREAD_PRIORITY_SCHEDULING
>>> +#ifdef	_POSIX_THREAD_PRIORITY_SCHEDULING
>>>  	if(pri)
>>>  	{
>>>  		struct sched_param sched;
>>> @@ -220,8 +220,9 @@
>>>  			pri = sched_get_priority_min(policy);
>>> 
>>>  		sched.sched_priority = pri;
>>> +		pthread_attr_setschedpolicy(&_attr, policy);
>>>  		pthread_attr_setschedparam(&_attr, &sched);
>>> -	}
>>> +	}
>>>  #endif
>>>  #endif
>>> 
>>> @@ -289,7 +290,7 @@
>>>  	{
>>>  		pthread_detach(_tid);
>>>  		if(_start)
>>> -		{
>>> +		{
>>>  			_start->Post();
>>>  			return 0;
>>>  		}
>>> @@ -351,7 +352,7 @@
>>>  			Thread::_timer->OnTimer();
>>>  		}
>>>  		else
>>> -#endif
>>> +#endif
>>>  		    if(th)
>>>  			th->OnTimer();
>>>  		break;
>>> @@ -386,7 +387,7 @@
>>> 
>>>  	if(!setjmp(th->_env))
>>>  	{
>>> -		th->Initial();
>>> +		th->Initial();
>>>  		if(th->getCancel() == THREAD_CANCEL_INITIAL)
>>>  			th->setCancel(THREAD_CANCEL_DEFAULT);
>>> 
>>> @@ -411,7 +412,7 @@
>>> 
>>>  #ifdef	HAVE_SETITIMER
>>>  	struct itimerval itimer;
>>> -
>>> +
>>>  	memset(&itimer, 0, sizeof(itimer));
>>>  	itimer.it_value.tv_usec = (timer * 1000) % 1000000;
>>>  	itimer.it_value.tv_sec = timer / 1000;
>>> @@ -419,7 +420,7 @@
>>>  	timer /= 1000;
>>>  #endif
>>> 
>>> -#ifndef	_SIG_THREAD_ALARM
>>> +#ifndef	_SIG_THREAD_ALARM
>>>  	_arm;
>>>  	_timer = this;
>>>  #endif
>>> @@ -432,7 +433,7 @@
>>>  #else
>>>  	alarm(timer);
>>>  #endif
>>> -}
>>> +}
>>> 
>>>  timeout_t Thread::getTimer(void)
>>>  {
>>> @@ -491,7 +492,7 @@
>>>  #else
>>>  	sigwait(&mask, &signo);
>>>  #endif
>>> -}
>>> +}
>>> 
>>>  void	Thread::setSuspend(thread_suspend_t mode)
>>>  {
>>> @@ -518,7 +519,7 @@
>>> 
>>>  	sigemptyset(&mask);
>>>  	sigaddset(&mask, _SIG_THREAD_CANCEL);
>>> -
>>> +
>>>  	switch(mode)
>>>  	{
>>>  	case THREAD_CANCEL_IMMEDIATE:
>>> @@ -545,7 +546,7 @@
>>>  		pthread_sigmask(SIG_UNBLOCK, &sigs, NULL);
>>>  	else
>>>  		pthread_sigmask(SIG_BLOCK, &sigs, NULL);
>>> -}
>>> +}
>>> 
>>>  void	Thread::setCancel(thread_cancel_t mode)
>>>  {
>>> @@ -580,7 +581,7 @@
>>>  	sigemptyset(&cancel);
>>>  	sigaddset(&cancel, _SIG_THREAD_CANCEL);
>>> 
>>> -	if(_cancel != THREAD_CANCEL_DISABLED &&
>>> +	if(_cancel != THREAD_CANCEL_DISABLED &&
>>>  	   _cancel != THREAD_CANCEL_INITIAL)
>>>  		pthread_sigmask(SIG_UNBLOCK, &cancel, &old);
>>>  #else
>>> @@ -600,28 +601,28 @@
>>>  {
>>>  #ifdef  _SIG_THREAD_CANCEL
>>>          sigset_t cancel, old;
>>> -
>>> +
>>>          sigemptyset(&cancel);
>>>          sigaddset(&cancel, _SIG_THREAD_CANCEL);
>>> -
>>> +
>>>          if(_cancel != THREAD_CANCEL_DISABLED &&
>>>             _cancel != THREAD_CANCEL_INITIAL)
>>>                  pthread_sigmask(SIG_UNBLOCK, &cancel, &old);
>>>  #else
>>>          pthread_testcancel();
>>>  #endif
>>> -
>>> +
>>>  #ifdef  _SIG_THREAD_CANCEL
>>>          if(_cancel != THREAD_CANCEL_DISABLED)
>>>                  pthread_sigmask(SIG_SETMASK, &old, NULL);
>>>  #endif
>>> -}
>>> +}
>>> 
>>> 
>>>  void siginstall(int signo)
>>>  {
>>>  	struct sigaction act;
>>> -
>>> +
>>>  	act.sa_handler = (signalexec_t)&sigHandler;
>>>  	sigemptyset(&act.sa_mask);
>>> 
>>> 
>>> 
>>> 
>>> _______________________________________________
>>> Bug-commoncpp mailing list
>>> Bug-commoncpp@gnu.org
>>> http://mail.gnu.org/mailman/listinfo/bug-commoncpp
>> 
>> 


--------------030103040801050803090600
Content-Type: text/cpp;
 name="thread.cpp"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="thread.cpp"

// Copyright (C) 1999-2001 Open Source Telecom Corporation.
//  
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
// 
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
// 
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software 
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
// 
// As a special exception to the GNU General Public License, permission is 
// granted for additional uses of the text contained in its release 
// of Common C++.
// 
// The exception is that, if you link the Common C++ library with other
// files to produce an executable, this does not by itself cause the
// resulting executable to be covered by the GNU General Public License.
// Your use of that executable is in no way restricted on account of
// linking the Common C++ library code into it.
//
// This exception does not however invalidate any other reasons why
// the executable file might be covered by the GNU General Public License.
//
// This exception applies only to the code released under the 
// name Common C++.  If you copy code from other releases into a copy of
// Common C++, as the General Public License permits, the exception does
// not apply to the code that you add in this way.  To avoid misleading
// anyone as to the status of such modified files, you must delete
// this exception notice from them.
// 
// If you write modifications of your own for Common C++, it is your choice
// whether to permit this exception to apply to your modifications.
// If you do not wish that, delete this exception notice.  

#include "config.h"
#include "macros.h"
#include "thread.h"
#include <stdlib.h>

typedef	void	*(*exec_t)(void *);
typedef	RETSIGTYPE (*signalexec_t)(int);

#ifdef	_SIG_THREAD_CANCEL

static	RETSIGTYPE	sigcancel(int)
{
	pthread_exit(NULL);
}

#endif

#ifndef	_SIG_THREAD_STOPCONT
#ifndef _THR_SUNOS5

static	RETSIGTYPE	sigsuspend(int)
{
	sigset_t sigs;

	sigemptyset(&sigs);
	sigaddset(&sigs, SIGUSR3);
#ifdef	HAVE_SIGWAIT2
	sigwait(&sigs, NULL);
#else
	sigwait(&sigs);
#endif
}
#endif
#endif

static	sigset_t *blocked_signals(sigset_t *sig)
{
	sigemptyset(sig);
	sigaddset(sig, SIGINT);
	sigaddset(sig, SIGKILL);
	sigaddset(sig, SIGHUP);
	sigaddset(sig, SIGABRT);
	sigaddset(sig, SIGALRM);
	sigaddset(sig, SIGPIPE);
#ifndef	_SIG_THREAD_STOPCONT
	sigaddset(sig, SIGUSR3);
#endif
	return sig;
}

class MainThread : public Thread
{
protected:
	void Run(void) {return;};
	void OnSignal(int signo) {exit(signo);};

public:
	MainThread() : Thread(true) {};
};

static	ThreadKey _self;
static	MainThread _mainthread;

Thread	*Thread::_main = NULL;

#ifndef	_SIG_THREAD_ALARM
Thread	*Thread::_timer = NULL;
Mutex	Thread::_arm;
#endif

Thread::Thread(bool flag)
{
	_tid = pthread_self();
	_throw = THROW_OBJECT;
	_parent = NULL;
	_msgpos = 0;
	struct sigaction act;

	if(flag == true)
	{
		siginstall(SIGHUP);
		siginstall(SIGALRM);
		siginstall(SIGPIPE);
		siginstall(SIGABRT);

		act.sa_handler = (signalexec_t)&sigHandler;
		sigemptyset(&act.sa_mask);
#ifdef	SA_RESTART
		act.sa_flags = SA_RESTART;
#else
		act.sa_flags = 0;
#endif
#ifdef	SA_INTERRUPT
		act.sa_flags |= SA_INTERRUPT;
#endif
#ifdef	SIGPOLL
		sigaction(SIGPOLL, &act, NULL);
#else
		sigaction(SIGIO, &act, NULL);
#endif		

#ifndef	_SIG_THREAD_STOPCONT
#ifndef	_THR_SUNOS5
		act.sa_handler = sigsuspend;
		sigemptyset(&act.sa_mask);
#ifdef	SA_RESTART
		act.sa_flags = SA_RESTART;
#else
		act.sa_flags = 0;
#endif
		sigaction(SIGUSR3, &act, NULL);
#endif
#endif

#ifdef	_SIG_THREAD_CANCEL
		act.sa_flags = 0;
		act.sa_handler = sigcancel;
		sigemptyset(&act.sa_mask);
		sigaddset(&act.sa_mask, SIGHUP);
		sigaddset(&act.sa_mask, SIGALRM);
		sigaddset(&act.sa_mask, SIGPIPE);

		sigaction(_SIG_THREAD_CANCEL, &act, NULL);
#endif		
		_main = this;
    	}
	_self.setKey(this);
}	

Thread::Thread(Semaphore *start, int pri, size_t stack)
{
	int	rc;

	_msgpos = 0;
	_tid = 0;

	pthread_attr_init(&_attr);
	pthread_attr_setdetachstate(&_attr, PTHREAD_CREATE_JOINABLE);

#ifdef	PTHREAD_STACK_MIN
	if(pthread_attr_setstacksize(&_attr, stack <= PTHREAD_STACK_MIN ? PTHREAD_STACK_MIN : stack))
	{
		switch(getException())
		{
		case THROW_OBJECT:
			throw(this);
		default:
			return;
		}
	}
#endif

#ifndef	__FreeBSD__
#ifdef	_POSIX_THREAD_PRIORITY_SCHEDULING
#define	__HAS_PRIORITY_SCHEDULING__	
	if(pri)
	{
		struct sched_param sched;
		int policy;

		policy = sched_getscheduler(0);
		if(policy < 0)
		{
			switch(getException())
			{
			case THROW_OBJECT:
				throw(this);
			default:
				return;
			}
		}

		sched_getparam(0, &sched);

		pri = sched.sched_priority - pri;
		if(pri 	> sched_get_priority_max(policy))
			pri = sched_get_priority_max(policy);

		if(pri < sched_get_priority_min(policy))
			pri = sched_get_priority_min(policy);

		sched.sched_priority = pri;
		pthread_attr_setschedpolicy(&_attr, policy);
		pthread_attr_setschedparam(&_attr, &sched);
	}	
#endif
#endif

#ifdef	__HAS_PRIORITY_SCHEDULING__
	if(!pri)
	        pthread_attr_setinheritsched(&_attr, PTHREAD_INHERIT_SCHED);             
#else
        pthread_attr_setinheritsched(&_attr, PTHREAD_INHERIT_SCHED);             
#endif

	_parent = getThread();
	_throw = _parent->_throw;
	if(!_parent)
		_parent = this;

	_cancel = THREAD_CANCEL_INITIAL;
	_start = start;

	if(_start)
	{
		rc = pthread_create(&_tid, &_attr, exec_t(&execHandler), this);
		if(rc && getException() == THROW_OBJECT)
			throw(this);
	}
};

Thread::Thread(const Thread &th)
{
	sigset_t mask, newmask;
	int rc;

	_parent = th._parent;
	_cancel = THREAD_CANCEL_INITIAL;
	pthread_sigmask(SIG_BLOCK, blocked_signals(&newmask), &mask);
	rc = pthread_create(&_tid, &_attr, exec_t(&execHandler), this);
	pthread_sigmask(SIG_SETMASK, &mask, NULL);
	if(rc && getException() == THROW_OBJECT)
		throw(this);
}

bool Thread::isThread(void)
{
	return (_tid == pthread_self()) ? true : false;
}

bool Thread::isRunning(void)
{
	return (_tid != 0) ? true : false;
}

int Thread::Start(Semaphore *start)
{
	if(_tid)
	{
		if(_start)
		{
			_start->Post();
			return 0;
		}
		else
			return -1;
	}

	_start = start;
	return pthread_create(&_tid, &_attr, exec_t(&execHandler), this);
}

int Thread::Detach(Semaphore *start)
{
	int rtn;
	if(_tid)
	{
		pthread_detach(_tid);
		if(_start)
		{	
			_start->Post();
			return 0;
		}
		else
			return -1;
	}

	_start = start;
	rtn = pthread_create(&_tid, &_attr, exec_t(&execHandler), this);
	if(!rtn && _tid)
		pthread_detach(_tid);
}

void Thread::Terminate(void)
{
	if(!_tid)
		return;

	if(pthread_self() != _tid)
	{
		// assure thread has ran before we try to cancel...
		if(_start)
			_start->Post();

		pthread_cancel(_tid);
		if(!pthread_join(_tid, NULL) && _parent)
			_parent->Notify(this);
		_tid = 0;
	}
	pthread_attr_destroy(&_attr);
}

extern "C"
{

  void sigHandler(int signo)
  {
	Thread	*th = getThread();

	switch(signo)
	{
	case SIGHUP:
		if(th)
			th->OnHangup();
		break;
	case SIGABRT:
		if(th)
			th->OnException();
		break;
	case SIGPIPE:
		if(th)
			th->OnDisconnect();
		break;
	case SIGALRM:
#ifndef	_SIG_THREAD_ALARM
		if(Thread::_timer)
		{
			Thread::_timer->_alarm = 0;
			Thread::_timer->OnTimer();
		}
		else
#endif 
		    if(th)
			th->OnTimer();
		break;
#ifdef	SIGPOLL
	case SIGPOLL:
#else
	case SIGIO:
#endif
		if(th)
			th->OnPolling();
		break;
	default:
		if(th)
			th->OnSignal(signo);
	}
  }

  void	execHandler(Thread *th)
  {
	sigset_t mask;

	pthread_sigmask(SIG_BLOCK, blocked_signals(&mask), NULL);
	_self.setKey(th);
	th->_tid = pthread_self();
	th->setCancel(THREAD_CANCEL_INITIAL);
	th->Yield();
	if(th->_start)
	{
		th->_start->Wait();
		th->_start = NULL;
	}

	if(!setjmp(th->_env))
	{
		th->Initial();	
		if(th->getCancel() == THREAD_CANCEL_INITIAL)
			th->setCancel(THREAD_CANCEL_DEFAULT);

		th->Run();
	}

#ifndef	_SIG_THREAD_ALARM
	if(th == Thread::_timer)
		--Thread::_arm;
#endif

	th->setCancel(THREAD_CANCEL_DISABLED);
	if(!pthread_detach(th->_tid) && th->_parent)
		th->_parent->Notify(th);
	th->Final();
	pthread_exit(NULL);
  }
}
void	Thread::setTimer(timeout_t timer)
{
	sigset_t sigs;

#ifdef	HAVE_SETITIMER
	struct itimerval itimer;
	
	memset(&itimer, 0, sizeof(itimer));
	itimer.it_value.tv_usec = (timer * 1000) % 1000000;
	itimer.it_value.tv_sec = timer / 1000;
#else
	timer /= 1000;
#endif

#ifndef	_SIG_THREAD_ALARM	
	_arm;
	_timer = this;
#endif
	time(&_alarm);
	sigemptyset(&sigs);
	sigaddset(&sigs, SIGALRM);
	pthread_sigmask(SIG_UNBLOCK, &sigs, NULL);
#ifdef	HAVE_SETITIMER
	setitimer(ITIMER_REAL, &itimer, NULL);
#else
	alarm(timer);
#endif
}	

timeout_t Thread::getTimer(void)
{
#ifdef	HAVE_SETITIMER
	struct itimerval itimer;
#endif

	if(!_alarm)
		return 0;

#ifdef	HAVE_SETITIMER
	getitimer(ITIMER_REAL, &itimer);
	return (timeout_t)(itimer.it_value.tv_sec * 1000 +
		itimer.it_value.tv_usec / 1000);
#else
	time_t now;
	time(&now);
	return (timeout_t)(((now - _alarm) * 1000) + 500);
#endif
}

void Thread::endTimer(void)
{
#ifdef	HAVE_SETITIMER
	static const struct itimerval itimer = {{0, 0},{0,0}};
#endif

	sigset_t sigs;
#ifndef	_SIG_THREAD_ALARM
	if(_timer != this)
		return;
#endif

#ifdef	HAVE_SETITIMER
	setitimer(ITIMER_REAL, (struct itimerval *)&itimer, NULL);
#else
	alarm(0);
#endif
	sigemptyset(&sigs);
	sigaddset(&sigs, SIGALRM);
	pthread_sigmask(SIG_BLOCK, &sigs, NULL);
#ifndef	_SIG_THREAD_ALARM
	--_arm;
	_timer = NULL;
#endif
}

void	Thread::WaitSignal(signo_t signo)
{
	sigset_t	mask;

	sigemptyset(&mask);
	sigaddset(&mask, signo);
#ifndef HAVE_SIGWAIT2
	signo = sigwait(&mask);
#else
	sigwait(&mask, &signo);
#endif
}	

void	Thread::setSuspend(thread_suspend_t mode)
{
	sigset_t mask;

	sigemptyset(&mask);
	sigaddset(&mask, _SIG_THREAD_SUSPEND);

	switch(mode)
	{
	case THREAD_SUSPEND_ENABLE:
		pthread_sigmask(SIG_UNBLOCK, &mask, NULL);
		return;
	case THREAD_SUSPEND_DISABLE:
		pthread_sigmask(SIG_BLOCK, &mask, NULL);
	}
}

#ifdef	_SIG_THREAD_CANCEL

void	Thread::setCancel(thread_cancel_t mode)
{
	sigset_t	mask;

	sigemptyset(&mask);
	sigaddset(&mask, _SIG_THREAD_CANCEL);
	
	switch(mode)
	{
	case THREAD_CANCEL_IMMEDIATE:
		pthread_sigmask(SIG_UNBLOCK, &mask, NULL);
		break;
	case THREAD_CANCEL_INITIAL:
	case THREAD_CANCEL_DISABLED:
	case THREAD_CANCEL_DEFERRED:
		pthread_sigmask(SIG_BLOCK, &mask, NULL);
		break;
	}
	_cancel = mode;
}
#else

void	Thread::setSignal(int signo, bool mode)
{
	sigset_t sigs;

	sigemptyset(&sigs);
	sigaddset(&sigs, signo);

	if(mode)
		pthread_sigmask(SIG_UNBLOCK, &sigs, NULL);
	else
		pthread_sigmask(SIG_BLOCK, &sigs, NULL);
}	

void	Thread::setCancel(thread_cancel_t mode)
{
	switch(mode)
	{
	case THREAD_CANCEL_IMMEDIATE:
		pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, NULL);
		pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL);
		break;
	case THREAD_CANCEL_DEFERRED:
		pthread_setcanceltype(PTHREAD_CANCEL_DEFERRED, NULL);
		pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL);
		break;
	case THREAD_CANCEL_INITIAL:
	case THREAD_CANCEL_DISABLED:
		pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, NULL);
		break;
	default:
		mode = THREAD_CANCEL_INVALID;
	}
	if(mode != THREAD_CANCEL_INVALID)
		_cancel = mode;
}

#endif

void	Thread::Yield(void)
{
#ifdef	_SIG_THREAD_CANCEL
	sigset_t cancel, old;

	sigemptyset(&cancel);
	sigaddset(&cancel, _SIG_THREAD_CANCEL);

	if(_cancel != THREAD_CANCEL_DISABLED && 
	   _cancel != THREAD_CANCEL_INITIAL)
		pthread_sigmask(SIG_UNBLOCK, &cancel, &old);
#else
	pthread_testcancel();
#endif
#ifdef	HAVE_PTHREAD_YIELD
	pthread_yield();
#endif

#ifdef	_SIG_THREAD_CANCEL
	if(_cancel != THREAD_CANCEL_DISABLED)
		pthread_sigmask(SIG_SETMASK, &old, NULL);
#endif
}

void Thread::testCancel(void)
{
#ifdef  _SIG_THREAD_CANCEL
        sigset_t cancel, old;
 
        sigemptyset(&cancel);
        sigaddset(&cancel, _SIG_THREAD_CANCEL);
 
        if(_cancel != THREAD_CANCEL_DISABLED &&
           _cancel != THREAD_CANCEL_INITIAL)
                pthread_sigmask(SIG_UNBLOCK, &cancel, &old);
#else
        pthread_testcancel();
#endif
 
#ifdef  _SIG_THREAD_CANCEL
        if(_cancel != THREAD_CANCEL_DISABLED)
                pthread_sigmask(SIG_SETMASK, &old, NULL);
#endif
} 


void siginstall(int signo)
{
	struct sigaction act;
	
	act.sa_handler = (signalexec_t)&sigHandler;
	sigemptyset(&act.sa_mask);

#ifdef	SA_INTERRUPT
	act.sa_flags = SA_INTERRUPT;
#else
	act.sa_flags = 0;
#endif
	sigaction(signo, &act, NULL);
}

Thread *getThread(void)
{
	Thread *thread;

	if(!Thread::_main)
		return &_mainthread;

	thread = (Thread *)_self.getKey();

	if(!thread)
	{
		thread = (Thread *)new MainThread;
		_self.setKey(thread);
	}
	return thread;
}

#ifdef	__CCXX_USE_POLL

Poller::Poller()
{
	nufds = 0;
	ufds = NULL;
};


Poller::~Poller()
{
	if(ufds)
		delete[] ufds;
}

pollfd *Poller::getList(int cnt)
{
	if(nufds < cnt)
	{
		if(ufds)
			delete[] ufds;
		ufds = new pollfd[cnt];
		nufds = cnt;
	}
	return ufds;
}

#endif

/** EMACS **
 * Local variables:
 * mode: c++
 * c-basic-offset: 8
 * End:
 */

--------------030103040801050803090600--



From f.natter@ndh.net Fri Jun 22 11:55:17 2001
Received: from public.ndh.net ([195.94.90.21] helo=public.ndh.com)
	by fencepost.gnu.org with smtp (Exim 3.16 #1 (Debian))
	id 15DTHA-0005DD-00
	for <bug-commoncpp@gnu.org>; Fri, 22 Jun 2001 11:55:16 -0400
Received: from 195.94.93.215 (port215.bonn.ndh.net [195.94.93.215]) by public.ndh.com (8.9.3/8.8.0) with ESMTP id RAA06027 for <bug-commoncpp@gnu.org>; Fri, 22 Jun 2001 17:55:09 +0200 (MET DST)
Received: (qmail 256 invoked by uid 1000); 22 Jun 2001 13:23:34 -0000
To: bug-commoncpp@gnu.org
Subject: fixes for gcc 3.0
From: Felix Natter <f.natter@ndh.net>
Date: 22 Jun 2001 15:23:34 +0200
Message-ID: <8766dofy21.fsf@mybaby.home.felix>
Lines: 90
User-Agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
Sender: bug-commoncpp-admin@gnu.org
Errors-To: bug-commoncpp-admin@gnu.org
X-BeenThere: bug-commoncpp@gnu.org
X-Mailman-Version: 2.0.5
Precedence: bulk
List-Help: <mailto:bug-commoncpp-request@gnu.org?subject=help>
List-Post: <mailto:bug-commoncpp@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=subscribe>
List-Id: Bug reports for Common C++ <bug-commoncpp.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=unsubscribe>
List-Archive: <http://mail.gnu.org/pipermail/bug-commoncpp/>

--=-=-=

hi,

I attached a patch which makes Common-C++ 1.4.3 compilable with gcc 3.0.

- remove using-decls in headers (!)
(you should never put a using-declaration in a header)
- I added a std::-prefix even in *.cpp-files. If you want to, you
can replace all these prefixes by doing this:
        using std::cout;
        using std::endl;
or
        using namespace std;
but this can only be done in *.cpp-files (!)
- header-file-fixes (e.g. <iostream.h>=><iostream>, <stdlib.h>=><cstdlib>)
- socket.cpp,slog.h: <strstream> (or <strstream.h> or <strstrea.h>) don't seem
to be used so I removed the #include's
- socket.cpp,slog.cpp: remove std::iostream::init(this)/
std::ostream::init(this) in favor of the corresponding std::iostream (or
std::ostream..)-constructor (the empty std::iostream-constructor is not in
the C++ standard)
- socket.cpp,serial.cpp: missing std::streambuf::setb(...)
=> this is not in the C++ standard (gcc 3.0 does not provide it).
I commented it out but I haven't yet found a "proper" solution
(I posted to comp.lang.c++ but didn't yet get a reply)
- add casts (e.g. startDocumentSAXFunc) in posix/xml.cpp
- common/misc.h:
In file included from mempager.cpp:45:
misc.h:503: friend declaration requires class-key, i.e. `friend class 
   StringTokenizer'
misc.h:588: friend declaration requires class-key, i.e. `friend class 
   StringTokenizer::iterator'
- xmlfetch.cpp:59: buffer needs a cast to (char*)
- demo/tcpthread.cpp: unsetf(
=> unsetf only accepts format-flags (gcc 2.95.x used unsigned long
to represent format-flags and open-modes, so you never got an error
until gcc 3.0, which uses enums, see below)
here is the message I posted to comp.lang.c++ and the reply I got:
"John Harrison" <jahhaj@bigfoot.com> writes:
> "Felix Natter" <f.natter@ndh.net> wrote in message
> news:87u21aas9k.fsf@mybaby.home.felix...
> > hi,
> >
> > when compiling with gcc 3, I get the following error:
> >
> > tcpthread.cpp: In constructor
> `myTCPSession::myTCPSession(cc_TCPSocket&)':
> > tcpthread.cpp:88: no matching function for call to
> `myTCPSession::unsetf(const
> >    std::_Ios_Openmode&)'
> > /opt/gcc3/include/g++-v3/bits/ios_base.h:340: candidates are: void
> >    std::ios_base::unsetf(std::_Ios_Fmtflags)
> >
> > the code is this:
> >
> > myTCPSession::myTCPSession(TCPSocket &server) :
> > TCPSession(NULL, server)
> > {
> > std::cout << "creating session client object" << std::endl;
> > mutex.EnterMutex();
> > ++count;
> > mutex.LeaveMutex();
> >     unsetf(std::ios::binary);
> > }
> >
> > thanks,
> >
> > --
> > Felix Natter
> >
> 
> std::ios::binary isn't a format flag and can't be passed to unsetf. The
> only place you can use std::ios::binary is when you open a stream.
> 
> john

- all these changes make the code compilable with gcc 3.0, but demo/tcp*
fail when compiling with gcc 3.0 (when compiling with gcc 2.95.3
they seem to work just fine).
Nevertheless I *believe* that the changes I made are correct, but some of
your code must be non-standard. 
If you want to track this down, you will have to set up gcc 3.0 as
a secondary compiler (you should probably keep gcc 2.95.x around to make
sure that the code remains compatible with it). If you need help with this,
just tell me.

-- 
Felix Natter

--=-=-=
Content-Type: text/x-patch
Content-Disposition: attachment; filename=CommonC++-1.4.3-gcc3.diff
Content-Description: fixes for gcc 3.0

Only in tmp/CommonC++-1.4.3/: CommonC++.spec
Only in CommonC++-1.4.3: bin
Only in tmp/CommonC++-1.4.3/common: config.def
diff -r tmp/CommonC++-1.4.3/common/digest.cpp CommonC++-1.4.3/common/digest.cpp
49c49
< streambuf(), ostream()
---
> std::streambuf(), std::ostream(this)
51d50
< 	ostream::init((streambuf *)this);
78c77
< ostream &ChecksumDigest::strDigest(ostream &os)
---
> std::ostream &ChecksumDigest::strDigest(std::ostream &os)
116c115
< ostream &CRC16Digest::strDigest(ostream &os)
---
> std::ostream &CRC16Digest::strDigest(std::ostream &os)
diff -r tmp/CommonC++-1.4.3/common/digest.h CommonC++-1.4.3/common/digest.h
52,53c52,53
< #include <iostream.h>
< #include <fstream.h>
---
> #include <iostream>
> #include <fstream>
58c58
< #include <strstream.h>
---
> #include <strstream>
71c71
< class Digest : public streambuf, public ostream
---
> class Digest : public std::streambuf, public std::ostream
109c109
< 	virtual ostream &strDigest(ostream &os) = 0;
---
> 	virtual std::ostream &strDigest(std::ostream &os) = 0;
111c111
< 	friend ostream &operator<<(ostream &os, Digest &ia)
---
> 	friend std::ostream &operator<<(std::ostream &os, Digest &ia)
128c128
< 	ostream &strDigest(ostream &os);
---
> 	std::ostream &strDigest(std::ostream &os);
157c157
< 	ostream &strDigest(ostream &os);
---
> 	std::ostream &strDigest(std::ostream &os);
diff -r tmp/CommonC++-1.4.3/common/keydata.cpp CommonC++-1.4.3/common/keydata.cpp
41,42c41,42
< #include <stdlib.h>
< #include <string.h>
---
> #include <cstdlib>
> #include <string>
51c51
< ifstream Keydata::cfgFile;
---
> std::ifstream Keydata::cfgFile;
284c284
< 		cfgFile.open(path, ios::in);
---
> 		cfgFile.open(path, std::ios::in);
286c286
< 			cfgFile.open(path + 5, ios::in);
---
> 			cfgFile.open(path + 5, std::ios::in);
diff -r tmp/CommonC++-1.4.3/common/misc.h CommonC++-1.4.3/common/misc.h
52c52
< #include <fstream.h>
---
> #include <fstream>
282c282
< 	static ifstream cfgFile;
---
> 	static std::ifstream cfgFile;
503c503
< 		friend StringTokenizer;  // access our private constructors
---
> 		friend class StringTokenizer;  // access our private constructors
588c588
< 	friend iterator;
---
> 	friend class StringTokenizer::iterator;
diff -r tmp/CommonC++-1.4.3/common/persist.h CommonC++-1.4.3/common/persist.h
64c64
< #include <iostream.h>
---
> #include <iostream>
76,79d75
< using std::string;
< using std::map;
< using std::vector;
< 
83,84c79,80
< 	__MEMBER_EXPORT PersistException(const string& reason);
< 	__MEMBER_EXPORT const string& GetMessage() const;
---
> 	__MEMBER_EXPORT PersistException(const std::string& reason);
> 	__MEMBER_EXPORT const std::string& GetMessage() const;
87c83
< 	string myMessage;
---
> 	std::string myMessage;
116c112
< 		string myName;
---
> 		std::string myName;
136c132
< 	typedef map<string,NewBaseObjectFunction> StringFunctionMap;
---
> 	typedef std::map<std::string,NewBaseObjectFunction> StringFunctionMap;
236c232
< 		Exception(const string &reason) : PersistException(reason) {}
---
> 		Exception(const std::string &reason) : PersistException(reason) {}
253c249
< 	__MEMBER_EXPORT Engine(iostream& stream, EngineMode mode) THROWS (PersistException);
---
> 	__MEMBER_EXPORT Engine(std::iostream& stream, EngineMode mode) THROWS (PersistException);
280c276
< 	void Write(const string& str) THROWS (Exception);
---
> 	void Write(const std::string& str) THROWS (Exception);
300c296
< 	void Read(string& str) THROWS (Exception);
---
> 	void Read(std::string& str) THROWS (Exception);
308c304
< 	iostream& myUnderlyingStream;
---
> 	std::iostream& myUnderlyingStream;
318,321c314,317
< 	typedef vector<BaseObject*>           ArchiveVector;
< 	typedef map<BaseObject const*, int32> ArchiveMap;
< 	typedef vector<string>                ClassVector;
< 	typedef map<string, int32>            ClassMap;
---
> 	typedef std::vector<BaseObject*>           ArchiveVector;
> 	typedef std::map<BaseObject const*, int32> ArchiveMap;
> 	typedef std::vector<std::string>                ClassVector;
> 	typedef std::map<std::string, int32>            ClassMap;
371,372c367,368
< __EXPORT Engine& operator >>( Engine& ar, string& ob) THROWS (Engine::Exception);
< __EXPORT Engine& operator <<( Engine& ar, string ob)  THROWS (Engine::Exception);
---
> __EXPORT Engine& operator >>( Engine& ar, std::string& ob) THROWS (Engine::Exception);
> __EXPORT Engine& operator <<( Engine& ar, std::string ob)  THROWS (Engine::Exception);
386c382
< Engine& operator <<( Engine& ar, vector<T> const& ob) THROWS (Engine::Exception)
---
> Engine& operator <<( Engine& ar, std::vector<T> const& ob) THROWS (Engine::Exception)
399c395
< Engine& operator >>( Engine& ar, vector<T>& ob) THROWS (Engine::Exception)
---
> Engine& operator >>( Engine& ar, std::vector<T>& ob) THROWS (Engine::Exception)
415c411
< Engine& operator <<( Engine& ar, map<Key,Value> const & ob) THROWS (Engine::Exception)
---
> Engine& operator <<( Engine& ar, std::map<Key,Value> const & ob) THROWS (Engine::Exception)
418c414
< 	for(map<Key,Value>::const_iterator it = ob.begin();it != ob.end();++it)
---
> 	for(std::map<Key,Value>::const_iterator it = ob.begin();it != ob.end();++it)
428c424
< Engine& operator >>( Engine& ar, map<Key,Value>& ob) THROWS (Engine::Exception)
---
> Engine& operator >>( Engine& ar, std::map<Key,Value>& ob) THROWS (Engine::Exception)
diff -r tmp/CommonC++-1.4.3/demo/bug1.cpp CommonC++-1.4.3/demo/bug1.cpp
52,53c52,53
< 	void Run() { cout << "Run()..." << endl;};
< 	void Final() { cout << "Final()..." << endl; delete this;};
---
> 	void Run() { std::cout << "Run()..." << std::endl;};
> 	void Final() { std::cout << "Final()..." << std::endl; delete this;};
59c59
< 	cout << "before start()..." << endl;
---
> 	std::cout << "before start()..." << std::endl;
62c62
< 	cout << "exiting..." << endl;
---
> 	std::cout << "exiting..." << std::endl;
diff -r tmp/CommonC++-1.4.3/demo/cmdlineopt.cpp CommonC++-1.4.3/demo/cmdlineopt.cpp
115c115
< 		cerr << args->PrintUsage();
---
> 		std::cerr << args->PrintUsage();
121,122c121,122
< 		cerr << args->PrintErrors();
< 		cerr << args->PrintUsage();
---
> 		std::cerr << args->PrintErrors();
> 		std::cerr << args->PrintUsage();
131c131,132
< 		cerr << "test_option1 = " << test_option1.values[ i ] << endl;
---
> 		std::cerr << "test_option1 = " << test_option1.values[ i ] 
> 			  << std::endl;
136c137,138
< 		cerr << "restoargs " << i << " : " << restoargs.values[ i ] << endl;
---
> 		std::cerr << "restoargs " << i << " : " << restoargs.values[i]
> 			  << std::endl;
161,162c163,164
< #include <string.h>
< #include <stdlib.h>
---
> #include <string>
> #include <cstdlib>
201c203
< 				strstream msg;
---
> 				std::strstream msg;
233c235
< 			cerr
---
> 			std::cerr
293c295
< 		cerr << args->PrintUsage();
---
> 		std::cerr << args->PrintUsage();
299,300c301,302
< 		cerr << args->PrintErrors();
< 		cerr << "Get help by --help\n";
---
> 		std::cerr << args->PrintErrors();
> 		std::cerr << "Get help by --help\n";
308c310,311
< 		cerr << "test_file = " << test_file.values[ i ] << endl;
---
> 		std::cerr << "test_file = " << test_file.values[ i ]
> 			  << std::endl;
312c315,316
< 		cerr << "test_restoargs " << i << " : " << test_restoargs.values[ i ] << endl;
---
> 		std::cerr << "test_restoargs " << i << " : "
> 			  << test_restoargs.values[ i ] << std::endl;
diff -r tmp/CommonC++-1.4.3/demo/serialecho.cpp CommonC++-1.4.3/demo/serialecho.cpp
59c59
<   cout << "Creating SerialEcho" << endl;
---
>   std::cout << "Creating SerialEcho" << std::endl;
65c65
<     cout << "modem ready" << endl;
---
>     std::cout << "modem ready" << std::endl;
70,74c70,74
<   if (setSpeed(38400)) cout << getErrorString() << endl;
<   if (setCharBits(8)) cout << getErrorString() << endl;
<   if (setParity(SERIAL_PARITY_NONE)) cout << getErrorString() << endl;
<   if (setStopBits(1)) cout << getErrorString() << endl;
<   if (setFlowControl(SERIAL_FLOW_HARD)) cout << getErrorString() << endl;
---
>   if (setSpeed(38400)) std::cout << getErrorString() << std::endl;
>   if (setCharBits(8)) std::cout << getErrorString() << std::endl;
>   if (setParity(SERIAL_PARITY_NONE)) std::cout << getErrorString() <<std::endl;
>   if (setStopBits(1)) std::cout << getErrorString() << std::endl;
>   if (setFlowControl(SERIAL_FLOW_HARD)) std::cout<<getErrorString()<<std::endl;
76c76
<   cout << "config done" << endl;
---
>   std::cout << "config done" << std::endl;
80c80
<   cout << "polling method call" << endl;
---
>   std::cout << "polling method call" << std::endl;
85c85
<   cout << "polling method call" << endl;
---
>   std::cout << "polling method call" << std::endl;
92c92
<   cout << "start monitor" << endl;
---
>   std::cout << "start monitor" << std::endl;
96c96
<       cout.put( get() );
---
>       std::cout.put( get() );
101c101
<   cout << "end of monitor" << endl;
---
>   std::cout << "end of monitor" << std::endl;
diff -r tmp/CommonC++-1.4.3/demo/serialmain.cpp CommonC++-1.4.3/demo/serialmain.cpp
58c58
<   cout << "Serial Echo to TCP Sessions" << endl;
---
>   std::cout << "Serial Echo to TCP Sessions" << std::endl;
63c63
<     cout << "Modem Error; aborting" << endl;
---
>     std::cout << "Modem Error; aborting" << std::endl;
66c66
<     cout << "Serial Error: " 
---
>     std::cout << "Serial Error: " 
69c69
<          << endl;
---
>          << std::endl;
75c75
<   cout << "Modem code:" << modem->Start() << endl;
---
>   std::cout << "Modem code:" << modem->Start() << std::endl;
77c77
<   while (cin >> b, b[0]) {
---
>   while (std::cin >> b, b[0]) {
79c79
<     *modem << b << "\r" << endl;
---
>     *modem << b << "\r" << std::endl;
81c81
<     cout << "sent: " << b << endl;
---
>     std::cout << "sent: " << b << std::endl;
85c85
<   cout << "fin" << endl;
---
>   std::cout << "fin" << std::endl;
diff -r tmp/CommonC++-1.4.3/demo/tcp.cpp CommonC++-1.4.3/demo/tcp.cpp
45,46c45,46
< #include <iostream.h>
< #include <stdlib.h>
---
> #include <iostream>
> #include <cstdlib>
61c61
< 	cout << "accepting from: " << ia << ":" << port << endl;;
---
> 	std::cout << "accepting from: " << ia << ":" << port << std::endl;
71c71
< 	cout << "testing addr: " << addr << ":" << 4096 << endl;
---
> 	std::cout << "testing addr: " << addr << ":" << 4096 << std::endl;
74c74
< 	cout << "binding for: " << addr << ":" << 4096 << endl;
---
> 	std::cout << "binding for: " << addr << ":" << 4096 << std::endl;
83c83
< 			tcp << "welcome to " << addr << endl;
---
> 			tcp << "welcome to " << addr << std::endl;
87c87
< 				tcp << "user entered " << i << endl;
---
> 				tcp << "user entered " << i << std::endl;
89c89
< 			tcp << "exiting now" << endl;
---
> 			tcp << "exiting now" << std::endl;
97,98c97,100
< 		cerr << "socket error " << saddr << ":" << port << endl; 
< 		cout << "error number " << socket->getErrorNumber() << endl;		
---
> 		std::cerr << "socket error " << saddr << ":" << port
> 			  << std::endl; 
> 		std::cout << "error number " << socket->getErrorNumber()
> 			  << std::endl;		
101c103
< 			cerr << "bind failed; no resources" << endl;
---
> 		        std::cerr << "bind failed; no resources" << std::endl;
106c108
< 			cerr << "bind failed; port busy" << endl;
---
> 			std::cerr << "bind failed; port busy" << std::endl;
110c112,113
< 	cout << "timeout after 30 seconds inactivity, exiting" << endl;
---
> 	std::cout << "timeout after 30 seconds inactivity, exiting"
> 		  << std::endl;
diff -r tmp/CommonC++-1.4.3/demo/tcpservice.cpp CommonC++-1.4.3/demo/tcpservice.cpp
35c35
< #include <iostream.h>
---
> #include <iostream>
49c49
< typedef ::list<ts_list_item *> ts_list;
---
> typedef std::list<ts_list_item *> ts_list;
149c149
< 	cerr << "ChatterSession deleted !\n";
---
> 	std::cerr << "ChatterSession deleted !\n";
162c162
< 	cerr << "ChatterSession Created\n";
---
> 	std::cerr << "ChatterSession Created\n";
167,168c167,168
< 	cerr << "connecting from " << ia.getHostname() <<
< 	":" << port << endl;
---
> 	std::cerr << "connecting from " << ia.getHostname()
> 		  << ":" << port << std::endl;
185c185
< 	cerr << "ChatterSession Expired\n";
---
> 	std::cerr << "ChatterSession Expired\n";
198c198
< 	cerr << "Pending called\n";
---
> 	std::cerr << "Pending called\n";
207,209c207,209
< 		cerr << "Read '";
< 		cerr.write( buf, len );
< 		cerr << "'\n";
---
> 		std::cerr << "Read '";
> 		std::cerr.write( buf, len );
> 		std::cerr << "'\n";
247c247
< 	    cerr << "Socket port write sent an exception !\n";
---
> 	    std::cerr << "Socket port write sent an exception !\n";
256c256
< 	cerr << "ChatterSession disconnected!\n";
---
> 	std::cerr << "ChatterSession disconnected!\n";
322c322
< 		cerr << "ChatterSession create failed\n";
---
> 		std::cerr << "ChatterSession create failed\n";
368c368
< 	cerr << "machine is not address" << endl;
---
> 	std::cerr << "machine is not address" << std::endl;
371c371
<     cerr << "machine is " << machine.getHostname() << endl;
---
>     std::cerr << "machine is " << machine.getHostname() << std::endl;
385c385
< 	cerr << "Failed to bind\n";
---
> 	std::cerr << "Failed to bind\n";
diff -r tmp/CommonC++-1.4.3/demo/tcpthread.cpp CommonC++-1.4.3/demo/tcpthread.cpp
72c72,73
< 	cout << "accepting from: " << ia.getHostname() << ":" << port << endl;;
---
> 	std::cout << "accepting from: " << ia.getHostname() << ":" << port
> 		  << std::endl;;
83c84
< 	cout << "creating session client object" << endl;
---
> 	std::cout << "creating session client object" << std::endl;
87c88
< 	unsetf(ios::binary);
---
> 	//TODO:!!        unsetf(std::ios::binary);
93c94,95
< 	*tcp() << "welcome to " << addr.getHostname() << " from socket " << so << endl;
---
> 	*tcp() << "welcome to " << addr.getHostname() << " from socket " 
> 	       << so << std::endl;
95c97
< 	*tcp() << "called from thread " << count << endl;
---
> 	*tcp() << "called from thread " << count << std::endl;
98c100
< 	*tcp() << "ending session" << endl;
---
> 	*tcp() << "ending session" << std::endl;
111c113,114
< 	cout << "testing addr: " << addr.getHostname() << ":" << 4096 << endl;
---
> 	std::cout << "testing addr: " << addr.getHostname() << ":" << 4096
> 		  << std::endl;
113c116,117
< 	cout << "binding for: " << addr.getHostname() << ":" << 4096 << endl;
---
> 	std::cout << "binding for: " << addr.getHostname() << ":" << 4096
> 	     << std::endl;
121c125
< 			cout << "before create" << endl;
---
> 			std::cout << "before create" << std::endl;
123c127
< 			cout << "after create" << endl;
---
> 			std::cout << "after create" << std::endl;
132c136,137
< 		cerr << "socket error " << saddr.getHostname() << ":" << port << " = " << err << endl; 
---
> 		std::cerr << "socket error " << saddr.getHostname()
> 			  << ":" << port << " = " << err << std::endl; 
135c140
< 			cerr << "bind failed; port busy" << endl;
---
> 			std::cerr << "bind failed; port busy" << std::endl;
139c144
< 			cerr << "client socket failed" << endl;
---
> 			std::cerr << "client socket failed" << std::endl;
141c146,147
< 	cout << "timeout after 30 seconds inactivity, exiting" << endl;
---
> 	std::cout << "timeout after 30 seconds inactivity, exiting"
> 		  << std::endl;
diff -r tmp/CommonC++-1.4.3/demo/urlfetch.cpp CommonC++-1.4.3/demo/urlfetch.cpp
45,46c45,46
< #include <iostream.h>
< #include <stdlib.h>
---
> #include <iostream>
> #include <cstdlib>
53c53
< 		cout << "HEADER " << header << "=" << value << endl;
---
> 		std::cout << "HEADER " << header << "=" << value << std::endl;
70c70
< 			cout << "fetching " << *argv << endl;
---
> 			std::cout << "fetching " << *argv << std::endl;
74c74,75
< 				cout << "failed; reason=" << status << endl;
---
> 				std::cout << "failed; reason=" << status 
> 					  << std::endl;
78c79
< 			cout << "loading..." << endl;
---
> 			std::cout << "loading..." << std::endl;
84c85
< 					cout.write(cbuf, len);
---
> 					std::cout.write(cbuf, len);
86c87
< //				cout << cbuf << endl;
---
> //				std::cout << cbuf << std::endl;
89c90
< 			cout << ends;
---
> 			std::cout << std::ends;
94c95
< 		cerr << "url " << *argv << " failed" << endl;
---
> 		std::cerr << "url " << *argv << " failed" << std::endl;
diff -r tmp/CommonC++-1.4.3/demo/xmlfetch.cpp CommonC++-1.4.3/demo/xmlfetch.cpp
46,47c46,47
< #include <iostream.h>
< #include <stdlib.h>
---
> #include <iostream>
> #include <cstdlib>
59c59
< 		read(buffer, len);
---
> 		read((char*)buffer, len);
Only in CommonC++-1.4.3/doc: Makefile
Only in CommonC++-1.4.3/freebsd: Makefile
Only in CommonC++-1.4.3/m4: Makefile
Only in tmp/CommonC++-1.4.3/posix: ccgnu-config
diff -r tmp/CommonC++-1.4.3/posix/cmdoptns.cpp CommonC++-1.4.3/posix/cmdoptns.cpp
53,54c53,54
< #include <stdlib.h>
< #include <iostream.h>
---
> #include <cstdlib>
> #include <iostream>
Only in tmp/CommonC++-1.4.3/posix: config.h
Only in CommonC++-1.4.3/posix: config.tmp
diff -r tmp/CommonC++-1.4.3/posix/fifo.cpp CommonC++-1.4.3/posix/fifo.cpp
50c50
< fstream()
---
> std::fstream()
56c56
< fstream()
---
> std::fstream()
69c69
< 	fstream::close();
---
> 	std::fstream::close();
87c87
< 	fstream::open(fname, ios::in | ios::out);
---
> 	std::fstream::open(fname, std::ios::in | std::ios::out);
99c99
< 	fstream()
---
> 	std::fstream()
111c111
< 	open(fname, ios::in | ios::out);
---
> 	open(fname, std::ios::in | std::ios::out);
diff -r tmp/CommonC++-1.4.3/posix/file.h CommonC++-1.4.3/posix/file.h
52c52
< #include <stdio.h>
---
> #include <cstdio>
56,57c56,57
< #include <iostream.h>
< #include <fstream.h>
---
> #include <iostream>
> #include <fstream>
147c147
< class fifostream : public fstream
---
> class fifostream : public std::fstream
190c190
< class FIFOSession : public Thread, public fstream
---
> class FIFOSession : public Thread, public std::fstream
diff -r tmp/CommonC++-1.4.3/posix/serial.cpp CommonC++-1.4.3/posix/serial.cpp
502c502
< Serial(filename), streambuf(), iostream()
---
> Serial(filename), std::streambuf(), std::iostream(this)
504d503
< 	iostream::init((streambuf *)this);
511,513c510
< Serial(), streambuf(), iostream()
< {
< 	iostream::init((streambuf *)this);
---
> Serial(), std::streambuf(), std::iostream(this){
561,563c558,560
< #if !(defined(STLPORT) || defined(__KCC))
< 	setb(gbuf, gbuf + bufsize, 0);
< #endif
---
> 	//#if !(defined(STLPORT) || defined(__KCC))
> 	//	setb(gbuf, gbuf + bufsize, 0);
> 	//#endif
591,593c588,590
< #if !(defined(STLPORT) || defined(__KCC))
< 		setb(0,0);
< #endif
---
> 		//#if !(defined(STLPORT) || defined(__KCC))
> 		//		setb(0,0);
> 		//#endif
614c611
< 				clear(ios::failbit | rdstate());
---
> 				clear(std::ios::failbit | rdstate());
642c639
< 			clear(ios::failbit | rdstate());
---
> 			clear(std::ios::failbit | rdstate());
676c673
< 				clear(ios::failbit | rdstate());
---
> 				clear(std::ios::failbit | rdstate());
693c690
< 				clear(ios::failbit | rdstate());
---
> 				clear(std::ios::failbit | rdstate());
diff -r tmp/CommonC++-1.4.3/posix/serial.h CommonC++-1.4.3/posix/serial.h
52c52
< #include <iostream.h>
---
> #include <iostream>
378c378
< class TTYStream : public streambuf, public iostream, public Serial
---
> class TTYStream : public std::streambuf, public std::iostream, public Serial
diff -r tmp/CommonC++-1.4.3/posix/slog.cpp CommonC++-1.4.3/posix/slog.cpp
50c50
< streambuf(), ostream()
---
> std::streambuf(), std::ostream(this)
52d51
< 	ostream::init((streambuf *)this);
110c109
< 			clog << thread->_msgbuf << endl;
---
> 			std::clog << thread->_msgbuf << std::endl;
diff -r tmp/CommonC++-1.4.3/posix/slog.h CommonC++-1.4.3/posix/slog.h
52,53c52
< #include <iostream.h>
< #include <strstream.h>
---
> #include <iostream>
93c92
< class Slog : public streambuf, public ostream
---
> class Slog : public std::streambuf, public std::ostream
diff -r tmp/CommonC++-1.4.3/posix/socket.cpp CommonC++-1.4.3/posix/socket.cpp
53c53
< #include <strstream.h>
---
> //#include <strstream>
55c55
< #include <strstrea.h>
---
> //#include <strstrea.h>
791,792c791,792
< 	,streambuf() 
< 	,iostream()
---
> 	,std::streambuf() 
> 	,std::iostream(this)
797d796
< 	iostream::init((streambuf *)this);
804c803
< 		clear(ios::failbit | rdstate());
---
> 		clear(std::ios::failbit | rdstate());
814c813
< 	streambuf(), iostream(),
---
> 	std::streambuf(), std::iostream(this),
817,818d815
< 	iostream::init((streambuf *)this);
< 
850c847
< 	streambuf(), iostream(), bufsize(0),gbuf(NULL),pbuf(NULL)
---
> 	std::streambuf(), std::iostream(this), bufsize(0),gbuf(NULL),pbuf(NULL)
852d848
< 	iostream::init((streambuf *)this);
857c853
< 	Socket(source.so), streambuf(), iostream() 
---
> 	Socket(source.so), std::streambuf(), std::iostream(this) 
859c855
< 	Socket(dup(source.so)), streambuf(), iostream() 
---
> 	Socket(dup(source.so)), std::streambuf(), std::iostream(this) 
862d857
< 	iostream::init((streambuf *)this);
894c889
< 	setb(gbuf, gbuf + size, 0);
---
> 	//	setb(gbuf, gbuf + size, 0);
935c930
< 				clear(ios::failbit | rdstate());
---
> 				clear(std::ios::failbit | rdstate());
955c950
< 			clear(ios::failbit | rdstate());
---
> 			clear(std::ios::failbit | rdstate());
997c992
< 				clear(ios::failbit | rdstate());
---
> 				clear(std::ios::failbit | rdstate());
1017c1012
< 				clear(ios::failbit | rdstate());
---
> 				clear(std::ios::failbit | rdstate());
1076c1071
< 		clear(ios::failbit | rdstate());
---
> 		clear(std::ios::failbit | rdstate());
1088,1092c1083,1087
< 		clog << "### Wrong OnAccept() signature! Overwrite \n"
< 		     << "\tbool OnAccept(const InetHostAddress &ia,\n"
< 		     << "\t              tpport_t port);\n"
< 		     << "\tThis OnAccept() does not work anymore.\n"
< 		     << "\t(short changed to tpport_t)" << endl;
---
> 		std::clog << "### Wrong OnAccept() signature! Overwrite \n"
> 			  << "\tbool OnAccept(const InetHostAddress &ia,\n"
> 			  << "\t              tpport_t port);\n"
> 			  << "\tThis OnAccept() does not work anymore.\n"
> 			  << "\t(short changed to tpport_t)" << std::endl;
1226c1221
< ostream &operator<<(ostream &os, const InetAddress &ia)
---
> std::ostream &operator<<(std::ostream &os, const InetAddress &ia)
diff -r tmp/CommonC++-1.4.3/posix/socket.h CommonC++-1.4.3/posix/socket.h
67c67
< #include <iostream.h>
---
> #include <iostream>
1280,1283c1280,1281
< #ifdef	__KCC
< using std::iostream;
< #endif
< class TCPStream : public Socket, public streambuf, public iostream
---
> 
> class TCPStream : public Socket, public std::streambuf, public std::iostream
1365,1366c1363,1364
< 	iostream *tcp(void)
< 		{return ((iostream *)this);};
---
> 	std::iostream *tcp(void)
> 		{return ((std::iostream *)this);};
1563c1561
< extern __EXPORT ::ostream &operator<<(::ostream &os, const InetAddress &ia);
---
> extern __EXPORT std::ostream &operator<<(std::ostream &os, const InetAddress &ia);
diff -r tmp/CommonC++-1.4.3/posix/url.cpp CommonC++-1.4.3/posix/url.cpp
51,52c51,52
< #include <string.h>
< #include <stdlib.h>
---
> #include <string>
> #include <cstdlib>
55c55
< #include <iostream.h>
---
> #include <iostream>
60c60
< #include <strstream.h>
---
> #include <strstream>
123c123
< 			clear(ios::failbit | rdstate());
---
> 			clear(std::ios::failbit | rdstate());
220c220
< 	iostream::getline(buffer, size);
---
> 	std::iostream::getline(buffer, size);
341c341
< 	strstream str(buffer, sizeof(buffer), ios::out);
---
> 	std::strstream str(buffer, sizeof(buffer), std::ios::out);
464c464
<         str << "\r\n" << ends;
---
>         str << "\r\n" << std::ends;
diff -r tmp/CommonC++-1.4.3/posix/xml.cpp CommonC++-1.4.3/posix/xml.cpp
120,123c120,123
< 	sax.startDocument = &saxStartDocument;
< 	sax.endDocument = &saxEndDocument;
< 	sax.startElement = &saxStartElement;
< 	sax.endElement = &saxEndElement;
---
> 	sax.startDocument = (startDocumentSAXFunc)&saxStartDocument;
> 	sax.endDocument = (endDocumentSAXFunc)&saxEndDocument;
> 	sax.startElement = (startElementSAXFunc)&saxStartElement;
> 	sax.endElement = (endElementSAXFunc)&saxEndElement;
Only in CommonC++-1.4.3: share
Only in CommonC++-1.4.3/win32: Makefile
diff -r tmp/CommonC++-1.4.3/win32/socket.h CommonC++-1.4.3/win32/socket.h
67c67
< #include <iostream.h>
---
> #include <iostream>
1280,1283c1280,1281
< #ifdef	__KCC
< using std::iostream;
< #endif
< class TCPStream : public Socket, public streambuf, public iostream
---
> 
> class TCPStream : public Socket, public std::streambuf, public std::iostream

--=-=-=--


From ianc@band-x.net Fri Jun 22 12:54:27 2001
Received: from vector.band-x.net ([213.166.0.219])
	by fencepost.gnu.org with esmtp (Exim 3.16 #1 (Debian))
	id 15DUCQ-00078G-00
	for <bug-commoncpp@gnu.org>; Fri, 22 Jun 2001 12:54:27 -0400
Received: (qmail 4259 invoked by uid 1006); 22 Jun 2001 16:54:25 -0000
Received: from ianc@band-x.net by pop3 with qmail-scanner-0.94 (uvscan: v4.0.70/v4122. . Clean. Processed in 0.106326 secs); 22/06/2001 17:54:25
Received: from unknown (HELO routing-resource.band-x.net) ([213.166.3.43]) (envelope-sender <ianc@band-x.net>)
          by vector.band-x.net (qmail-ldap-1.03) with SMTP
          for <dyfet@ostel.com>; 22 Jun 2001 16:54:25 -0000
Date: Fri, 22 Jun 2001 17:52:17 +0100 (BST)
From: Ian Campbell <ianc@band-x.net>
To: David Sugar <dyfet@ostel.com>
cc: "bug-commoncpp@gnu.org" <bug-commoncpp@gnu.org>
Subject: Re: Problems with Linux CommonC++ Thread Class scheduling
In-Reply-To: <3B335AA0.9070203@ostel.com>
Message-ID: <Pine.LNX.4.33.0106221751480.25606-100000@routing-resource.band-x.net>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
Sender: bug-commoncpp-admin@gnu.org
Errors-To: bug-commoncpp-admin@gnu.org
X-BeenThere: bug-commoncpp@gnu.org
X-Mailman-Version: 2.0.5
Precedence: bulk
List-Help: <mailto:bug-commoncpp-request@gnu.org?subject=help>
List-Post: <mailto:bug-commoncpp@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=subscribe>
List-Id: Bug reports for Common C++ <bug-commoncpp.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=unsubscribe>
List-Archive: <http://mail.gnu.org/pipermail/bug-commoncpp/>

David,
	Seems to compile and work fine.

Cheers,

Ian

Ian Campbell
Band-X
t: +44 (0) 207 932 8846
f: +44 (0) 207 932 8800
e: ianc@band-x.net

On Fri, 22 Jun 2001, David Sugar wrote:

> Okay, I have attached what I think will be the final version of this...
>
>
> Ian Campbell wrote:
>
> > The code below that gets the priority and the policy of the creating
> > process and uses that to create the new thread so that should be ok. Not
> > sure what happens in other implementations though.
> >
> > Ian
> >
> > Ian Campbell
> > Band-X
> > t: +44 (0) 207 932 8846
> > f: +44 (0) 207 932 8800
> > e: ianc@band-x.net
> >
> > On Fri, 22 Jun 2001, David Sugar wrote:
> >
> >
> >> I have thought about this more, and I think the most correct solution is that
> >> the setinherit should be called, but only when pri = 0, which indicates you do
> >> want it scheduled the same as the parent, or in systems which do not allow
> >> setting and changing of scheduler priorities anyway.  So I will do a more
> >> specific implimentation of this.
> >>
> >> David
> >>
> >> Ian Campbell wrote:
> >>
> >>
> >>> Hello All,
> >>>         I have been experimenting with the CommonC++ Thread class on Linux
> >>> using the realtime pthread scheduler (either SCHED_RR or SCHED_FIFO) and
> >>> found it doesn't work properly in the 1.4.3 release. This fault means that
> >>> you can't give seperate threads a different priority from the creating
> >>> main process. This is caused by a call to pthread_attr_setinheritsched()
> >>> which according to the man page means that the priority and policy for
> >>> thread scheduler must be inherited from the creating thread. As such any
> >>> subsequent calls to pthread_attr_setschedpolicy() and
> >>> pthread_attr_setschedparam() will have no effect. Anyway the patch at the
> >>> end of this email should fixeth the problem.
> >>>
> >>> Cheers,
> >>>
> >>> Ian Campbell
> >>> Band-X
> >>> t: +44 (0) 207 932 8846
> >>> f: +44 (0) 207 932 8800
> >>> e: ianc@band-x.net
> >>>
> >>> diff -u -r CommonC++-1.4.3/posix/thread.cpp
> >>> CommonC++-1.4.3-sched.patch/posix/thread.cpp
> >>> --- CommonC++-1.4.3/posix/thread.cpp	Thu May 31 08:30:51 2001
> >>> +++ CommonC++-1.4.3-sched.patch/posix/thread.cpp	Thu Jun 21
> >>> 12:41:08 2001
> >>> @@ -1,23 +1,23 @@
> >>>  // Copyright (C) 1999-2001 Open Source Telecom Corporation.
> >>> -//
> >>> +//
> >>>  // This program is free software; you can redistribute it and/or modify
> >>>  // it under the terms of the GNU General Public License as published by
> >>>  // the Free Software Foundation; either version 2 of the License, or
> >>>  // (at your option) any later version.
> >>> -//
> >>> +//
> >>>  // This program is distributed in the hope that it will be useful,
> >>>  // but WITHOUT ANY WARRANTY; without even the implied warranty of
> >>>  // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> >>>  // GNU General Public License for more details.
> >>> -//
> >>> +//
> >>>  // You should have received a copy of the GNU General Public License
> >>> -// along with this program; if not, write to the Free Software
> >>> +// along with this program; if not, write to the Free Software
> >>>  // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
> >>> USA.
> >>> -//
> >>> -// As a special exception to the GNU General Public License, permission
> >>> is
> >>> -// granted for additional uses of the text contained in its release
> >>> +//
> >>> +// As a special exception to the GNU General Public License, permission
> >>> is
> >>> +// granted for additional uses of the text contained in its release
> >>>  // of Common C++.
> >>> -//
> >>> +//
> >>>  // The exception is that, if you link the Common C++ library with other
> >>>  // files to produce an executable, this does not by itself cause the
> >>>  // resulting executable to be covered by the GNU General Public License.
> >>> @@ -27,16 +27,16 @@
> >>>  // This exception does not however invalidate any other reasons why
> >>>  // the executable file might be covered by the GNU General Public
> >>> License.
> >>>  //
> >>> -// This exception applies only to the code released under the
> >>> +// This exception applies only to the code released under the
> >>>  // name Common C++.  If you copy code from other releases into a copy of
> >>>  // Common C++, as the General Public License permits, the exception does
> >>>  // not apply to the code that you add in this way.  To avoid misleading
> >>>  // anyone as to the status of such modified files, you must delete
> >>>  // this exception notice from them.
> >>> -//
> >>> +//
> >>>  // If you write modifications of your own for Common C++, it is your
> >>> choice
> >>>  // whether to permit this exception to apply to your modifications.
> >>> -// If you do not wish that, delete this exception notice.
> >>> +// If you do not wish that, delete this exception notice.
> >>>
> >>>  #include "config.h"
> >>>  #include "macros.h"
> >>> @@ -137,7 +137,7 @@
> >>>  		sigaction(SIGPOLL, &act, NULL);
> >>>  #else
> >>>  		sigaction(SIGIO, &act, NULL);
> >>> -#endif
> >>> +#endif
> >>>
> >>>  #ifndef	_SIG_THREAD_STOPCONT
> >>>  #ifndef	_THR_SUNOS5
> >>> @@ -161,11 +161,11 @@
> >>>  		sigaddset(&act.sa_mask, SIGPIPE);
> >>>
> >>>  		sigaction(_SIG_THREAD_CANCEL, &act, NULL);
> >>> -#endif
> >>> +#endif
> >>>  		_main = this;
> >>>      	}
> >>>  	_self.setKey(this);
> >>> -}
> >>> +}
> >>>
> >>>  Thread::Thread(Semaphore *start, int pri, size_t stack)
> >>>  {
> >>> @@ -176,7 +176,7 @@
> >>>
> >>>  	pthread_attr_init(&_attr);
> >>>  	pthread_attr_setdetachstate(&_attr, PTHREAD_CREATE_JOINABLE);
> >>> -	pthread_attr_setinheritsched(&_attr, PTHREAD_INHERIT_SCHED);
> >>> +
> >>>
> >>>  #ifdef	PTHREAD_STACK_MIN
> >>>  	if(pthread_attr_setstacksize(&_attr, stack <= PTHREAD_STACK_MIN ?
> >>> PTHREAD_STACK_MIN : stack))
> >>> @@ -192,7 +192,7 @@
> >>>  #endif
> >>>
> >>>  #ifndef	__FreeBSD__
> >>> -#ifdef	_POSIX_THREAD_PRIORITY_SCHEDULING
> >>> +#ifdef	_POSIX_THREAD_PRIORITY_SCHEDULING
> >>>  	if(pri)
> >>>  	{
> >>>  		struct sched_param sched;
> >>> @@ -220,8 +220,9 @@
> >>>  			pri = sched_get_priority_min(policy);
> >>>
> >>>  		sched.sched_priority = pri;
> >>> +		pthread_attr_setschedpolicy(&_attr, policy);
> >>>  		pthread_attr_setschedparam(&_attr, &sched);
> >>> -	}
> >>> +	}
> >>>  #endif
> >>>  #endif
> >>>
> >>> @@ -289,7 +290,7 @@
> >>>  	{
> >>>  		pthread_detach(_tid);
> >>>  		if(_start)
> >>> -		{
> >>> +		{
> >>>  			_start->Post();
> >>>  			return 0;
> >>>  		}
> >>> @@ -351,7 +352,7 @@
> >>>  			Thread::_timer->OnTimer();
> >>>  		}
> >>>  		else
> >>> -#endif
> >>> +#endif
> >>>  		    if(th)
> >>>  			th->OnTimer();
> >>>  		break;
> >>> @@ -386,7 +387,7 @@
> >>>
> >>>  	if(!setjmp(th->_env))
> >>>  	{
> >>> -		th->Initial();
> >>> +		th->Initial();
> >>>  		if(th->getCancel() == THREAD_CANCEL_INITIAL)
> >>>  			th->setCancel(THREAD_CANCEL_DEFAULT);
> >>>
> >>> @@ -411,7 +412,7 @@
> >>>
> >>>  #ifdef	HAVE_SETITIMER
> >>>  	struct itimerval itimer;
> >>> -
> >>> +
> >>>  	memset(&itimer, 0, sizeof(itimer));
> >>>  	itimer.it_value.tv_usec = (timer * 1000) % 1000000;
> >>>  	itimer.it_value.tv_sec = timer / 1000;
> >>> @@ -419,7 +420,7 @@
> >>>  	timer /= 1000;
> >>>  #endif
> >>>
> >>> -#ifndef	_SIG_THREAD_ALARM
> >>> +#ifndef	_SIG_THREAD_ALARM
> >>>  	_arm;
> >>>  	_timer = this;
> >>>  #endif
> >>> @@ -432,7 +433,7 @@
> >>>  #else
> >>>  	alarm(timer);
> >>>  #endif
> >>> -}
> >>> +}
> >>>
> >>>  timeout_t Thread::getTimer(void)
> >>>  {
> >>> @@ -491,7 +492,7 @@
> >>>  #else
> >>>  	sigwait(&mask, &signo);
> >>>  #endif
> >>> -}
> >>> +}
> >>>
> >>>  void	Thread::setSuspend(thread_suspend_t mode)
> >>>  {
> >>> @@ -518,7 +519,7 @@
> >>>
> >>>  	sigemptyset(&mask);
> >>>  	sigaddset(&mask, _SIG_THREAD_CANCEL);
> >>> -
> >>> +
> >>>  	switch(mode)
> >>>  	{
> >>>  	case THREAD_CANCEL_IMMEDIATE:
> >>> @@ -545,7 +546,7 @@
> >>>  		pthread_sigmask(SIG_UNBLOCK, &sigs, NULL);
> >>>  	else
> >>>  		pthread_sigmask(SIG_BLOCK, &sigs, NULL);
> >>> -}
> >>> +}
> >>>
> >>>  void	Thread::setCancel(thread_cancel_t mode)
> >>>  {
> >>> @@ -580,7 +581,7 @@
> >>>  	sigemptyset(&cancel);
> >>>  	sigaddset(&cancel, _SIG_THREAD_CANCEL);
> >>>
> >>> -	if(_cancel != THREAD_CANCEL_DISABLED &&
> >>> +	if(_cancel != THREAD_CANCEL_DISABLED &&
> >>>  	   _cancel != THREAD_CANCEL_INITIAL)
> >>>  		pthread_sigmask(SIG_UNBLOCK, &cancel, &old);
> >>>  #else
> >>> @@ -600,28 +601,28 @@
> >>>  {
> >>>  #ifdef  _SIG_THREAD_CANCEL
> >>>          sigset_t cancel, old;
> >>> -
> >>> +
> >>>          sigemptyset(&cancel);
> >>>          sigaddset(&cancel, _SIG_THREAD_CANCEL);
> >>> -
> >>> +
> >>>          if(_cancel != THREAD_CANCEL_DISABLED &&
> >>>             _cancel != THREAD_CANCEL_INITIAL)
> >>>                  pthread_sigmask(SIG_UNBLOCK, &cancel, &old);
> >>>  #else
> >>>          pthread_testcancel();
> >>>  #endif
> >>> -
> >>> +
> >>>  #ifdef  _SIG_THREAD_CANCEL
> >>>          if(_cancel != THREAD_CANCEL_DISABLED)
> >>>                  pthread_sigmask(SIG_SETMASK, &old, NULL);
> >>>  #endif
> >>> -}
> >>> +}
> >>>
> >>>
> >>>  void siginstall(int signo)
> >>>  {
> >>>  	struct sigaction act;
> >>> -
> >>> +
> >>>  	act.sa_handler = (signalexec_t)&sigHandler;
> >>>  	sigemptyset(&act.sa_mask);
> >>>
> >>>
> >>>
> >>>
> >>> _______________________________________________
> >>> Bug-commoncpp mailing list
> >>> Bug-commoncpp@gnu.org
> >>> http://mail.gnu.org/mailman/listinfo/bug-commoncpp
> >>
> >>
>
>



From dyfet@ostel.com Fri Jun 22 13:35:26 2001
Received: from [63.124.177.154] (helo=home.sys)
	by fencepost.gnu.org with smtp (Exim 3.16 #1 (Debian))
	id 15DUq1-0000JP-00
	for <bug-commoncpp@gnu.org>; Fri, 22 Jun 2001 13:35:22 -0400
Received: from ostel.com (home.sys [172.16.1.254])
	by home.sys (Postfix) with ESMTP
	id 98180A090C; Fri, 22 Jun 2001 13:33:05 -0400 (EDT)
Message-ID: <3B338151.50309@ostel.com>
Date: Fri, 22 Jun 2001 13:33:05 -0400
From: David Sugar <dyfet@ostel.com>
Organization: OST
User-Agent: Mozilla/5.0 (X11; U; Linux 2.2.16-9mdk i686; en-US; m18) Gecko/20001013
X-Accept-Language: en
MIME-Version: 1.0
To: Felix Natter <f.natter@ndh.net>
Cc: bug-commoncpp@gnu.org
Subject: Re: fixes for gcc 3.0
References: <8766dofy21.fsf@mybaby.home.felix>
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
Sender: bug-commoncpp-admin@gnu.org
Errors-To: bug-commoncpp-admin@gnu.org
X-BeenThere: bug-commoncpp@gnu.org
X-Mailman-Version: 2.0.5
Precedence: bulk
List-Help: <mailto:bug-commoncpp-request@gnu.org?subject=help>
List-Post: <mailto:bug-commoncpp@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=subscribe>
List-Id: Bug reports for Common C++ <bug-commoncpp.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=unsubscribe>
List-Archive: <http://mail.gnu.org/pipermail/bug-commoncpp/>

I have incorporated a lot of this into cvs now.  It should be interesting to 
see if the win32 streams will work with the newer (non strstrea.h) based 
streams library.

Felix Natter wrote:

> hi,
> 
> I attached a patch which makes Common-C++ 1.4.3 compilable with gcc 3.0.
> 
> - remove using-decls in headers (!)
> (you should never put a using-declaration in a header)
> - I added a std::-prefix even in *.cpp-files. If you want to, you
> can replace all these prefixes by doing this:
>         using std::cout;
>         using std::endl;
> or
>         using namespace std;
> but this can only be done in *.cpp-files (!)
> - header-file-fixes (e.g. <iostream.h>=><iostream>, <stdlib.h>=><cstdlib>)
> - socket.cpp,slog.h: <strstream> (or <strstream.h> or <strstrea.h>) don't seem
> to be used so I removed the #include's
> - socket.cpp,slog.cpp: remove std::iostream::init(this)/
> std::ostream::init(this) in favor of the corresponding std::iostream (or
> std::ostream..)-constructor (the empty std::iostream-constructor is not in
> the C++ standard)
> - socket.cpp,serial.cpp: missing std::streambuf::setb(...)
> => this is not in the C++ standard (gcc 3.0 does not provide it).
> I commented it out but I haven't yet found a "proper" solution
> (I posted to comp.lang.c++ but didn't yet get a reply)
> - add casts (e.g. startDocumentSAXFunc) in posix/xml.cpp
> - common/misc.h:
> In file included from mempager.cpp:45:
> misc.h:503: friend declaration requires class-key, i.e. `friend class 
>    StringTokenizer'
> misc.h:588: friend declaration requires class-key, i.e. `friend class 
>    StringTokenizer::iterator'
> - xmlfetch.cpp:59: buffer needs a cast to (char*)
> - demo/tcpthread.cpp: unsetf(
> => unsetf only accepts format-flags (gcc 2.95.x used unsigned long
> to represent format-flags and open-modes, so you never got an error
> until gcc 3.0, which uses enums, see below)
> here is the message I posted to comp.lang.c++ and the reply I got:
> "John Harrison" <jahhaj@bigfoot.com> writes:
> 
>> "Felix Natter" <f.natter@ndh.net> wrote in message
>> news:87u21aas9k.fsf@mybaby.home.felix...
>> 
>>> hi,
>>> 
>>> when compiling with gcc 3, I get the following error:
>>> 
>>> tcpthread.cpp: In constructor
>> 
>> `myTCPSession::myTCPSession(cc_TCPSocket&)':
>> 
>>> tcpthread.cpp:88: no matching function for call to
>> 
>> `myTCPSession::unsetf(const
>> 
>>>    std::_Ios_Openmode&)'
>>> /opt/gcc3/include/g++-v3/bits/ios_base.h:340: candidates are: void
>>>    std::ios_base::unsetf(std::_Ios_Fmtflags)
>>> 
>>> the code is this:
>>> 
>>> myTCPSession::myTCPSession(TCPSocket &server) :
>>> TCPSession(NULL, server)
>>> {
>>> std::cout << "creating session client object" << std::endl;
>>> mutex.EnterMutex();
>>> ++count;
>>> mutex.LeaveMutex();
>>>     unsetf(std::ios::binary);
>>> }
>>> 
>>> thanks,
>>> 
>>> --
>>> Felix Natter
>>> 
>> 
>> std::ios::binary isn't a format flag and can't be passed to unsetf. The
>> only place you can use std::ios::binary is when you open a stream.
>> 
>> john
> 
> 
> - all these changes make the code compilable with gcc 3.0, but demo/tcp*
> fail when compiling with gcc 3.0 (when compiling with gcc 2.95.3
> they seem to work just fine).
> Nevertheless I *believe* that the changes I made are correct, but some of
> your code must be non-standard. 
> If you want to track this down, you will have to set up gcc 3.0 as
> a secondary compiler (you should probably keep gcc 2.95.x around to make
> sure that the code remains compatible with it). If you need help with this,
> just tell me.
> 
> 
> 
> ------------------------------------------------------------------------
> 
> Only in tmp/CommonC++-1.4.3/: CommonC++.spec
> Only in CommonC++-1.4.3: bin
> Only in tmp/CommonC++-1.4.3/common: config.def
> diff -r tmp/CommonC++-1.4.3/common/digest.cpp CommonC++-1.4.3/common/digest.cpp
> 49c49
> < streambuf(), ostream()
> ---
> 
>> std::streambuf(), std::ostream(this)
> 
> 51d50
> < 	ostream::init((streambuf *)this);
> 78c77
> < ostream &ChecksumDigest::strDigest(ostream &os)
> ---
> 
>> std::ostream &ChecksumDigest::strDigest(std::ostream &os)
> 
> 116c115
> < ostream &CRC16Digest::strDigest(ostream &os)
> ---
> 
>> std::ostream &CRC16Digest::strDigest(std::ostream &os)
> 
> diff -r tmp/CommonC++-1.4.3/common/digest.h CommonC++-1.4.3/common/digest.h
> 52,53c52,53
> < #include <iostream.h>
> < #include <fstream.h>
> ---
> 
>> #include <iostream>
>> #include <fstream>
> 
> 58c58
> < #include <strstream.h>
> ---
> 
>> #include <strstream>
> 
> 71c71
> < class Digest : public streambuf, public ostream
> ---
> 
>> class Digest : public std::streambuf, public std::ostream
> 
> 109c109
> < 	virtual ostream &strDigest(ostream &os) = 0;
> ---
> 
>> 	virtual std::ostream &strDigest(std::ostream &os) = 0;
> 
> 111c111
> < 	friend ostream &operator<<(ostream &os, Digest &ia)
> ---
> 
>> 	friend std::ostream &operator<<(std::ostream &os, Digest &ia)
> 
> 128c128
> < 	ostream &strDigest(ostream &os);
> ---
> 
>> 	std::ostream &strDigest(std::ostream &os);
> 
> 157c157
> < 	ostream &strDigest(ostream &os);
> ---
> 
>> 	std::ostream &strDigest(std::ostream &os);
> 
> diff -r tmp/CommonC++-1.4.3/common/keydata.cpp CommonC++-1.4.3/common/keydata.cpp
> 41,42c41,42
> < #include <stdlib.h>
> < #include <string.h>
> ---
> 
>> #include <cstdlib>
>> #include <string>
> 
> 51c51
> < ifstream Keydata::cfgFile;
> ---
> 
>> std::ifstream Keydata::cfgFile;
> 
> 284c284
> < 		cfgFile.open(path, ios::in);
> ---
> 
>> 		cfgFile.open(path, std::ios::in);
> 
> 286c286
> < 			cfgFile.open(path + 5, ios::in);
> ---
> 
>> 			cfgFile.open(path + 5, std::ios::in);
> 
> diff -r tmp/CommonC++-1.4.3/common/misc.h CommonC++-1.4.3/common/misc.h
> 52c52
> < #include <fstream.h>
> ---
> 
>> #include <fstream>
> 
> 282c282
> < 	static ifstream cfgFile;
> ---
> 
>> 	static std::ifstream cfgFile;
> 
> 503c503
> < 		friend StringTokenizer;  // access our private constructors
> ---
> 
>> 		friend class StringTokenizer;  // access our private constructors
> 
> 588c588
> < 	friend iterator;
> ---
> 
>> 	friend class StringTokenizer::iterator;
> 
> diff -r tmp/CommonC++-1.4.3/common/persist.h CommonC++-1.4.3/common/persist.h
> 64c64
> < #include <iostream.h>
> ---
> 
>> #include <iostream>
> 
> 76,79d75
> < using std::string;
> < using std::map;
> < using std::vector;
> < 
> 83,84c79,80
> < 	__MEMBER_EXPORT PersistException(const string& reason);
> < 	__MEMBER_EXPORT const string& GetMessage() const;
> ---
> 
>> 	__MEMBER_EXPORT PersistException(const std::string& reason);
>> 	__MEMBER_EXPORT const std::string& GetMessage() const;
> 
> 87c83
> < 	string myMessage;
> ---
> 
>> 	std::string myMessage;
> 
> 116c112
> < 		string myName;
> ---
> 
>> 		std::string myName;
> 
> 136c132
> < 	typedef map<string,NewBaseObjectFunction> StringFunctionMap;
> ---
> 
>> 	typedef std::map<std::string,NewBaseObjectFunction> StringFunctionMap;
> 
> 236c232
> < 		Exception(const string &reason) : PersistException(reason) {}
> ---
> 
>> 		Exception(const std::string &reason) : PersistException(reason) {}
> 
> 253c249
> < 	__MEMBER_EXPORT Engine(iostream& stream, EngineMode mode) THROWS (PersistException);
> ---
> 
>> 	__MEMBER_EXPORT Engine(std::iostream& stream, EngineMode mode) THROWS (PersistException);
> 
> 280c276
> < 	void Write(const string& str) THROWS (Exception);
> ---
> 
>> 	void Write(const std::string& str) THROWS (Exception);
> 
> 300c296
> < 	void Read(string& str) THROWS (Exception);
> ---
> 
>> 	void Read(std::string& str) THROWS (Exception);
> 
> 308c304
> < 	iostream& myUnderlyingStream;
> ---
> 
>> 	std::iostream& myUnderlyingStream;
> 
> 318,321c314,317
> < 	typedef vector<BaseObject*>           ArchiveVector;
> < 	typedef map<BaseObject const*, int32> ArchiveMap;
> < 	typedef vector<string>                ClassVector;
> < 	typedef map<string, int32>            ClassMap;
> ---
> 
>> 	typedef std::vector<BaseObject*>           ArchiveVector;
>> 	typedef std::map<BaseObject const*, int32> ArchiveMap;
>> 	typedef std::vector<std::string>                ClassVector;
>> 	typedef std::map<std::string, int32>            ClassMap;
> 
> 371,372c367,368
> < __EXPORT Engine& operator >>( Engine& ar, string& ob) THROWS (Engine::Exception);
> < __EXPORT Engine& operator <<( Engine& ar, string ob)  THROWS (Engine::Exception);
> ---
> 
>> __EXPORT Engine& operator >>( Engine& ar, std::string& ob) THROWS (Engine::Exception);
>> __EXPORT Engine& operator <<( Engine& ar, std::string ob)  THROWS (Engine::Exception);
> 
> 386c382
> < Engine& operator <<( Engine& ar, vector<T> const& ob) THROWS (Engine::Exception)
> ---
> 
>> Engine& operator <<( Engine& ar, std::vector<T> const& ob) THROWS (Engine::Exception)
> 
> 399c395
> < Engine& operator >>( Engine& ar, vector<T>& ob) THROWS (Engine::Exception)
> ---
> 
>> Engine& operator >>( Engine& ar, std::vector<T>& ob) THROWS (Engine::Exception)
> 
> 415c411
> < Engine& operator <<( Engine& ar, map<Key,Value> const & ob) THROWS (Engine::Exception)
> ---
> 
>> Engine& operator <<( Engine& ar, std::map<Key,Value> const & ob) THROWS (Engine::Exception)
> 
> 418c414
> < 	for(map<Key,Value>::const_iterator it = ob.begin();it != ob.end();++it)
> ---
> 
>> 	for(std::map<Key,Value>::const_iterator it = ob.begin();it != ob.end();++it)
> 
> 428c424
> < Engine& operator >>( Engine& ar, map<Key,Value>& ob) THROWS (Engine::Exception)
> ---
> 
>> Engine& operator >>( Engine& ar, std::map<Key,Value>& ob) THROWS (Engine::Exception)
> 
> diff -r tmp/CommonC++-1.4.3/demo/bug1.cpp CommonC++-1.4.3/demo/bug1.cpp
> 52,53c52,53
> < 	void Run() { cout << "Run()..." << endl;};
> < 	void Final() { cout << "Final()..." << endl; delete this;};
> ---
> 
>> 	void Run() { std::cout << "Run()..." << std::endl;};
>> 	void Final() { std::cout << "Final()..." << std::endl; delete this;};
> 
> 59c59
> < 	cout << "before start()..." << endl;
> ---
> 
>> 	std::cout << "before start()..." << std::endl;
> 
> 62c62
> < 	cout << "exiting..." << endl;
> ---
> 
>> 	std::cout << "exiting..." << std::endl;
> 
> diff -r tmp/CommonC++-1.4.3/demo/cmdlineopt.cpp CommonC++-1.4.3/demo/cmdlineopt.cpp
> 115c115
> < 		cerr << args->PrintUsage();
> ---
> 
>> 		std::cerr << args->PrintUsage();
> 
> 121,122c121,122
> < 		cerr << args->PrintErrors();
> < 		cerr << args->PrintUsage();
> ---
> 
>> 		std::cerr << args->PrintErrors();
>> 		std::cerr << args->PrintUsage();
> 
> 131c131,132
> < 		cerr << "test_option1 = " << test_option1.values[ i ] << endl;
> ---
> 
>> 		std::cerr << "test_option1 = " << test_option1.values[ i ] 
>> 			  << std::endl;
> 
> 136c137,138
> < 		cerr << "restoargs " << i << " : " << restoargs.values[ i ] << endl;
> ---
> 
>> 		std::cerr << "restoargs " << i << " : " << restoargs.values[i]
>> 			  << std::endl;
> 
> 161,162c163,164
> < #include <string.h>
> < #include <stdlib.h>
> ---
> 
>> #include <string>
>> #include <cstdlib>
> 
> 201c203
> < 				strstream msg;
> ---
> 
>> 				std::strstream msg;
> 
> 233c235
> < 			cerr
> ---
> 
>> 			std::cerr
> 
> 293c295
> < 		cerr << args->PrintUsage();
> ---
> 
>> 		std::cerr << args->PrintUsage();
> 
> 299,300c301,302
> < 		cerr << args->PrintErrors();
> < 		cerr << "Get help by --help\n";
> ---
> 
>> 		std::cerr << args->PrintErrors();
>> 		std::cerr << "Get help by --help\n";
> 
> 308c310,311
> < 		cerr << "test_file = " << test_file.values[ i ] << endl;
> ---
> 
>> 		std::cerr << "test_file = " << test_file.values[ i ]
>> 			  << std::endl;
> 
> 312c315,316
> < 		cerr << "test_restoargs " << i << " : " << test_restoargs.values[ i ] << endl;
> ---
> 
>> 		std::cerr << "test_restoargs " << i << " : "
>> 			  << test_restoargs.values[ i ] << std::endl;
> 
> diff -r tmp/CommonC++-1.4.3/demo/serialecho.cpp CommonC++-1.4.3/demo/serialecho.cpp
> 59c59
> <   cout << "Creating SerialEcho" << endl;
> ---
> 
>>   std::cout << "Creating SerialEcho" << std::endl;
> 
> 65c65
> <     cout << "modem ready" << endl;
> ---
> 
>>     std::cout << "modem ready" << std::endl;
> 
> 70,74c70,74
> <   if (setSpeed(38400)) cout << getErrorString() << endl;
> <   if (setCharBits(8)) cout << getErrorString() << endl;
> <   if (setParity(SERIAL_PARITY_NONE)) cout << getErrorString() << endl;
> <   if (setStopBits(1)) cout << getErrorString() << endl;
> <   if (setFlowControl(SERIAL_FLOW_HARD)) cout << getErrorString() << endl;
> ---
> 
>>   if (setSpeed(38400)) std::cout << getErrorString() << std::endl;
>>   if (setCharBits(8)) std::cout << getErrorString() << std::endl;
>>   if (setParity(SERIAL_PARITY_NONE)) std::cout << getErrorString() <<std::endl;
>>   if (setStopBits(1)) std::cout << getErrorString() << std::endl;
>>   if (setFlowControl(SERIAL_FLOW_HARD)) std::cout<<getErrorString()<<std::endl;
> 
> 76c76
> <   cout << "config done" << endl;
> ---
> 
>>   std::cout << "config done" << std::endl;
> 
> 80c80
> <   cout << "polling method call" << endl;
> ---
> 
>>   std::cout << "polling method call" << std::endl;
> 
> 85c85
> <   cout << "polling method call" << endl;
> ---
> 
>>   std::cout << "polling method call" << std::endl;
> 
> 92c92
> <   cout << "start monitor" << endl;
> ---
> 
>>   std::cout << "start monitor" << std::endl;
> 
> 96c96
> <       cout.put( get() );
> ---
> 
>>       std::cout.put( get() );
> 
> 101c101
> <   cout << "end of monitor" << endl;
> ---
> 
>>   std::cout << "end of monitor" << std::endl;
> 
> diff -r tmp/CommonC++-1.4.3/demo/serialmain.cpp CommonC++-1.4.3/demo/serialmain.cpp
> 58c58
> <   cout << "Serial Echo to TCP Sessions" << endl;
> ---
> 
>>   std::cout << "Serial Echo to TCP Sessions" << std::endl;
> 
> 63c63
> <     cout << "Modem Error; aborting" << endl;
> ---
> 
>>     std::cout << "Modem Error; aborting" << std::endl;
> 
> 66c66
> <     cout << "Serial Error: " 
> ---
> 
>>     std::cout << "Serial Error: " 
> 
> 69c69
> <          << endl;
> ---
> 
>>          << std::endl;
> 
> 75c75
> <   cout << "Modem code:" << modem->Start() << endl;
> ---
> 
>>   std::cout << "Modem code:" << modem->Start() << std::endl;
> 
> 77c77
> <   while (cin >> b, b[0]) {
> ---
> 
>>   while (std::cin >> b, b[0]) {
> 
> 79c79
> <     *modem << b << "\r" << endl;
> ---
> 
>>     *modem << b << "\r" << std::endl;
> 
> 81c81
> <     cout << "sent: " << b << endl;
> ---
> 
>>     std::cout << "sent: " << b << std::endl;
> 
> 85c85
> <   cout << "fin" << endl;
> ---
> 
>>   std::cout << "fin" << std::endl;
> 
> diff -r tmp/CommonC++-1.4.3/demo/tcp.cpp CommonC++-1.4.3/demo/tcp.cpp
> 45,46c45,46
> < #include <iostream.h>
> < #include <stdlib.h>
> ---
> 
>> #include <iostream>
>> #include <cstdlib>
> 
> 61c61
> < 	cout << "accepting from: " << ia << ":" << port << endl;;
> ---
> 
>> 	std::cout << "accepting from: " << ia << ":" << port << std::endl;
> 
> 71c71
> < 	cout << "testing addr: " << addr << ":" << 4096 << endl;
> ---
> 
>> 	std::cout << "testing addr: " << addr << ":" << 4096 << std::endl;
> 
> 74c74
> < 	cout << "binding for: " << addr << ":" << 4096 << endl;
> ---
> 
>> 	std::cout << "binding for: " << addr << ":" << 4096 << std::endl;
> 
> 83c83
> < 			tcp << "welcome to " << addr << endl;
> ---
> 
>> 			tcp << "welcome to " << addr << std::endl;
> 
> 87c87
> < 				tcp << "user entered " << i << endl;
> ---
> 
>> 				tcp << "user entered " << i << std::endl;
> 
> 89c89
> < 			tcp << "exiting now" << endl;
> ---
> 
>> 			tcp << "exiting now" << std::endl;
> 
> 97,98c97,100
> < 		cerr << "socket error " << saddr << ":" << port << endl; 
> < 		cout << "error number " << socket->getErrorNumber() << endl;		
> ---
> 
>> 		std::cerr << "socket error " << saddr << ":" << port
>> 			  << std::endl; 
>> 		std::cout << "error number " << socket->getErrorNumber()
>> 			  << std::endl;		
> 
> 101c103
> < 			cerr << "bind failed; no resources" << endl;
> ---
> 
>> 		        std::cerr << "bind failed; no resources" << std::endl;
> 
> 106c108
> < 			cerr << "bind failed; port busy" << endl;
> ---
> 
>> 			std::cerr << "bind failed; port busy" << std::endl;
> 
> 110c112,113
> < 	cout << "timeout after 30 seconds inactivity, exiting" << endl;
> ---
> 
>> 	std::cout << "timeout after 30 seconds inactivity, exiting"
>> 		  << std::endl;
> 
> diff -r tmp/CommonC++-1.4.3/demo/tcpservice.cpp CommonC++-1.4.3/demo/tcpservice.cpp
> 35c35
> < #include <iostream.h>
> ---
> 
>> #include <iostream>
> 
> 49c49
> < typedef ::list<ts_list_item *> ts_list;
> ---
> 
>> typedef std::list<ts_list_item *> ts_list;
> 
> 149c149
> < 	cerr << "ChatterSession deleted !\n";
> ---
> 
>> 	std::cerr << "ChatterSession deleted !\n";
> 
> 162c162
> < 	cerr << "ChatterSession Created\n";
> ---
> 
>> 	std::cerr << "ChatterSession Created\n";
> 
> 167,168c167,168
> < 	cerr << "connecting from " << ia.getHostname() <<
> < 	":" << port << endl;
> ---
> 
>> 	std::cerr << "connecting from " << ia.getHostname()
>> 		  << ":" << port << std::endl;
> 
> 185c185
> < 	cerr << "ChatterSession Expired\n";
> ---
> 
>> 	std::cerr << "ChatterSession Expired\n";
> 
> 198c198
> < 	cerr << "Pending called\n";
> ---
> 
>> 	std::cerr << "Pending called\n";
> 
> 207,209c207,209
> < 		cerr << "Read '";
> < 		cerr.write( buf, len );
> < 		cerr << "'\n";
> ---
> 
>> 		std::cerr << "Read '";
>> 		std::cerr.write( buf, len );
>> 		std::cerr << "'\n";
> 
> 247c247
> < 	    cerr << "Socket port write sent an exception !\n";
> ---
> 
>> 	    std::cerr << "Socket port write sent an exception !\n";
> 
> 256c256
> < 	cerr << "ChatterSession disconnected!\n";
> ---
> 
>> 	std::cerr << "ChatterSession disconnected!\n";
> 
> 322c322
> < 		cerr << "ChatterSession create failed\n";
> ---
> 
>> 		std::cerr << "ChatterSession create failed\n";
> 
> 368c368
> < 	cerr << "machine is not address" << endl;
> ---
> 
>> 	std::cerr << "machine is not address" << std::endl;
> 
> 371c371
> <     cerr << "machine is " << machine.getHostname() << endl;
> ---
> 
>>     std::cerr << "machine is " << machine.getHostname() << std::endl;
> 
> 385c385
> < 	cerr << "Failed to bind\n";
> ---
> 
>> 	std::cerr << "Failed to bind\n";
> 
> diff -r tmp/CommonC++-1.4.3/demo/tcpthread.cpp CommonC++-1.4.3/demo/tcpthread.cpp
> 72c72,73
> < 	cout << "accepting from: " << ia.getHostname() << ":" << port << endl;;
> ---
> 
>> 	std::cout << "accepting from: " << ia.getHostname() << ":" << port
>> 		  << std::endl;;
> 
> 83c84
> < 	cout << "creating session client object" << endl;
> ---
> 
>> 	std::cout << "creating session client object" << std::endl;
> 
> 87c88
> < 	unsetf(ios::binary);
> ---
> 
>> 	//TODO:!!        unsetf(std::ios::binary);
> 
> 93c94,95
> < 	*tcp() << "welcome to " << addr.getHostname() << " from socket " << so << endl;
> ---
> 
>> 	*tcp() << "welcome to " << addr.getHostname() << " from socket " 
>> 	       << so << std::endl;
> 
> 95c97
> < 	*tcp() << "called from thread " << count << endl;
> ---
> 
>> 	*tcp() << "called from thread " << count << std::endl;
> 
> 98c100
> < 	*tcp() << "ending session" << endl;
> ---
> 
>> 	*tcp() << "ending session" << std::endl;
> 
> 111c113,114
> < 	cout << "testing addr: " << addr.getHostname() << ":" << 4096 << endl;
> ---
> 
>> 	std::cout << "testing addr: " << addr.getHostname() << ":" << 4096
>> 		  << std::endl;
> 
> 113c116,117
> < 	cout << "binding for: " << addr.getHostname() << ":" << 4096 << endl;
> ---
> 
>> 	std::cout << "binding for: " << addr.getHostname() << ":" << 4096
>> 	     << std::endl;
> 
> 121c125
> < 			cout << "before create" << endl;
> ---
> 
>> 			std::cout << "before create" << std::endl;
> 
> 123c127
> < 			cout << "after create" << endl;
> ---
> 
>> 			std::cout << "after create" << std::endl;
> 
> 132c136,137
> < 		cerr << "socket error " << saddr.getHostname() << ":" << port << " = " << err << endl; 
> ---
> 
>> 		std::cerr << "socket error " << saddr.getHostname()
>> 			  << ":" << port << " = " << err << std::endl; 
> 
> 135c140
> < 			cerr << "bind failed; port busy" << endl;
> ---
> 
>> 			std::cerr << "bind failed; port busy" << std::endl;
> 
> 139c144
> < 			cerr << "client socket failed" << endl;
> ---
> 
>> 			std::cerr << "client socket failed" << std::endl;
> 
> 141c146,147
> < 	cout << "timeout after 30 seconds inactivity, exiting" << endl;
> ---
> 
>> 	std::cout << "timeout after 30 seconds inactivity, exiting"
>> 		  << std::endl;
> 
> diff -r tmp/CommonC++-1.4.3/demo/urlfetch.cpp CommonC++-1.4.3/demo/urlfetch.cpp
> 45,46c45,46
> < #include <iostream.h>
> < #include <stdlib.h>
> ---
> 
>> #include <iostream>
>> #include <cstdlib>
> 
> 53c53
> < 		cout << "HEADER " << header << "=" << value << endl;
> ---
> 
>> 		std::cout << "HEADER " << header << "=" << value << std::endl;
> 
> 70c70
> < 			cout << "fetching " << *argv << endl;
> ---
> 
>> 			std::cout << "fetching " << *argv << std::endl;
> 
> 74c74,75
> < 				cout << "failed; reason=" << status << endl;
> ---
> 
>> 				std::cout << "failed; reason=" << status 
>> 					  << std::endl;
> 
> 78c79
> < 			cout << "loading..." << endl;
> ---
> 
>> 			std::cout << "loading..." << std::endl;
> 
> 84c85
> < 					cout.write(cbuf, len);
> ---
> 
>> 					std::cout.write(cbuf, len);
> 
> 86c87
> < //				cout << cbuf << endl;
> ---
> 
>> //				std::cout << cbuf << std::endl;
> 
> 89c90
> < 			cout << ends;
> ---
> 
>> 			std::cout << std::ends;
> 
> 94c95
> < 		cerr << "url " << *argv << " failed" << endl;
> ---
> 
>> 		std::cerr << "url " << *argv << " failed" << std::endl;
> 
> diff -r tmp/CommonC++-1.4.3/demo/xmlfetch.cpp CommonC++-1.4.3/demo/xmlfetch.cpp
> 46,47c46,47
> < #include <iostream.h>
> < #include <stdlib.h>
> ---
> 
>> #include <iostream>
>> #include <cstdlib>
> 
> 59c59
> < 		read(buffer, len);
> ---
> 
>> 		read((char*)buffer, len);
> 
> Only in CommonC++-1.4.3/doc: Makefile
> Only in CommonC++-1.4.3/freebsd: Makefile
> Only in CommonC++-1.4.3/m4: Makefile
> Only in tmp/CommonC++-1.4.3/posix: ccgnu-config
> diff -r tmp/CommonC++-1.4.3/posix/cmdoptns.cpp CommonC++-1.4.3/posix/cmdoptns.cpp
> 53,54c53,54
> < #include <stdlib.h>
> < #include <iostream.h>
> ---
> 
>> #include <cstdlib>
>> #include <iostream>
> 
> Only in tmp/CommonC++-1.4.3/posix: config.h
> Only in CommonC++-1.4.3/posix: config.tmp
> diff -r tmp/CommonC++-1.4.3/posix/fifo.cpp CommonC++-1.4.3/posix/fifo.cpp
> 50c50
> < fstream()
> ---
> 
>> std::fstream()
> 
> 56c56
> < fstream()
> ---
> 
>> std::fstream()
> 
> 69c69
> < 	fstream::close();
> ---
> 
>> 	std::fstream::close();
> 
> 87c87
> < 	fstream::open(fname, ios::in | ios::out);
> ---
> 
>> 	std::fstream::open(fname, std::ios::in | std::ios::out);
> 
> 99c99
> < 	fstream()
> ---
> 
>> 	std::fstream()
> 
> 111c111
> < 	open(fname, ios::in | ios::out);
> ---
> 
>> 	open(fname, std::ios::in | std::ios::out);
> 
> diff -r tmp/CommonC++-1.4.3/posix/file.h CommonC++-1.4.3/posix/file.h
> 52c52
> < #include <stdio.h>
> ---
> 
>> #include <cstdio>
> 
> 56,57c56,57
> < #include <iostream.h>
> < #include <fstream.h>
> ---
> 
>> #include <iostream>
>> #include <fstream>
> 
> 147c147
> < class fifostream : public fstream
> ---
> 
>> class fifostream : public std::fstream
> 
> 190c190
> < class FIFOSession : public Thread, public fstream
> ---
> 
>> class FIFOSession : public Thread, public std::fstream
> 
> diff -r tmp/CommonC++-1.4.3/posix/serial.cpp CommonC++-1.4.3/posix/serial.cpp
> 502c502
> < Serial(filename), streambuf(), iostream()
> ---
> 
>> Serial(filename), std::streambuf(), std::iostream(this)
> 
> 504d503
> < 	iostream::init((streambuf *)this);
> 511,513c510
> < Serial(), streambuf(), iostream()
> < {
> < 	iostream::init((streambuf *)this);
> ---
> 
>> Serial(), std::streambuf(), std::iostream(this){
> 
> 561,563c558,560
> < #if !(defined(STLPORT) || defined(__KCC))
> < 	setb(gbuf, gbuf + bufsize, 0);
> < #endif
> ---
> 
>> 	//#if !(defined(STLPORT) || defined(__KCC))
>> 	//	setb(gbuf, gbuf + bufsize, 0);
>> 	//#endif
> 
> 591,593c588,590
> < #if !(defined(STLPORT) || defined(__KCC))
> < 		setb(0,0);
> < #endif
> ---
> 
>> 		//#if !(defined(STLPORT) || defined(__KCC))
>> 		//		setb(0,0);
>> 		//#endif
> 
> 614c611
> < 				clear(ios::failbit | rdstate());
> ---
> 
>> 				clear(std::ios::failbit | rdstate());
> 
> 642c639
> < 			clear(ios::failbit | rdstate());
> ---
> 
>> 			clear(std::ios::failbit | rdstate());
> 
> 676c673
> < 				clear(ios::failbit | rdstate());
> ---
> 
>> 				clear(std::ios::failbit | rdstate());
> 
> 693c690
> < 				clear(ios::failbit | rdstate());
> ---
> 
>> 				clear(std::ios::failbit | rdstate());
> 
> diff -r tmp/CommonC++-1.4.3/posix/serial.h CommonC++-1.4.3/posix/serial.h
> 52c52
> < #include <iostream.h>
> ---
> 
>> #include <iostream>
> 
> 378c378
> < class TTYStream : public streambuf, public iostream, public Serial
> ---
> 
>> class TTYStream : public std::streambuf, public std::iostream, public Serial
> 
> diff -r tmp/CommonC++-1.4.3/posix/slog.cpp CommonC++-1.4.3/posix/slog.cpp
> 50c50
> < streambuf(), ostream()
> ---
> 
>> std::streambuf(), std::ostream(this)
> 
> 52d51
> < 	ostream::init((streambuf *)this);
> 110c109
> < 			clog << thread->_msgbuf << endl;
> ---
> 
>> 			std::clog << thread->_msgbuf << std::endl;
> 
> diff -r tmp/CommonC++-1.4.3/posix/slog.h CommonC++-1.4.3/posix/slog.h
> 52,53c52
> < #include <iostream.h>
> < #include <strstream.h>
> ---
> 
>> #include <iostream>
> 
> 93c92
> < class Slog : public streambuf, public ostream
> ---
> 
>> class Slog : public std::streambuf, public std::ostream
> 
> diff -r tmp/CommonC++-1.4.3/posix/socket.cpp CommonC++-1.4.3/posix/socket.cpp
> 53c53
> < #include <strstream.h>
> ---
> 
>> //#include <strstream>
> 
> 55c55
> < #include <strstrea.h>
> ---
> 
>> //#include <strstrea.h>
> 
> 791,792c791,792
> < 	,streambuf() 
> < 	,iostream()
> ---
> 
>> 	,std::streambuf() 
>> 	,std::iostream(this)
> 
> 797d796
> < 	iostream::init((streambuf *)this);
> 804c803
> < 		clear(ios::failbit | rdstate());
> ---
> 
>> 		clear(std::ios::failbit | rdstate());
> 
> 814c813
> < 	streambuf(), iostream(),
> ---
> 
>> 	std::streambuf(), std::iostream(this),
> 
> 817,818d815
> < 	iostream::init((streambuf *)this);
> < 
> 850c847
> < 	streambuf(), iostream(), bufsize(0),gbuf(NULL),pbuf(NULL)
> ---
> 
>> 	std::streambuf(), std::iostream(this), bufsize(0),gbuf(NULL),pbuf(NULL)
> 
> 852d848
> < 	iostream::init((streambuf *)this);
> 857c853
> < 	Socket(source.so), streambuf(), iostream() 
> ---
> 
>> 	Socket(source.so), std::streambuf(), std::iostream(this) 
> 
> 859c855
> < 	Socket(dup(source.so)), streambuf(), iostream() 
> ---
> 
>> 	Socket(dup(source.so)), std::streambuf(), std::iostream(this) 
> 
> 862d857
> < 	iostream::init((streambuf *)this);
> 894c889
> < 	setb(gbuf, gbuf + size, 0);
> ---
> 
>> 	//	setb(gbuf, gbuf + size, 0);
> 
> 935c930
> < 				clear(ios::failbit | rdstate());
> ---
> 
>> 				clear(std::ios::failbit | rdstate());
> 
> 955c950
> < 			clear(ios::failbit | rdstate());
> ---
> 
>> 			clear(std::ios::failbit | rdstate());
> 
> 997c992
> < 				clear(ios::failbit | rdstate());
> ---
> 
>> 				clear(std::ios::failbit | rdstate());
> 
> 1017c1012
> < 				clear(ios::failbit | rdstate());
> ---
> 
>> 				clear(std::ios::failbit | rdstate());
> 
> 1076c1071
> < 		clear(ios::failbit | rdstate());
> ---
> 
>> 		clear(std::ios::failbit | rdstate());
> 
> 1088,1092c1083,1087
> < 		clog << "### Wrong OnAccept() signature! Overwrite \n"
> < 		     << "\tbool OnAccept(const InetHostAddress &ia,\n"
> < 		     << "\t              tpport_t port);\n"
> < 		     << "\tThis OnAccept() does not work anymore.\n"
> < 		     << "\t(short changed to tpport_t)" << endl;
> ---
> 
>> 		std::clog << "### Wrong OnAccept() signature! Overwrite \n"
>> 			  << "\tbool OnAccept(const InetHostAddress &ia,\n"
>> 			  << "\t              tpport_t port);\n"
>> 			  << "\tThis OnAccept() does not work anymore.\n"
>> 			  << "\t(short changed to tpport_t)" << std::endl;
> 
> 1226c1221
> < ostream &operator<<(ostream &os, const InetAddress &ia)
> ---
> 
>> std::ostream &operator<<(std::ostream &os, const InetAddress &ia)
> 
> diff -r tmp/CommonC++-1.4.3/posix/socket.h CommonC++-1.4.3/posix/socket.h
> 67c67
> < #include <iostream.h>
> ---
> 
>> #include <iostream>
> 
> 1280,1283c1280,1281
> < #ifdef	__KCC
> < using std::iostream;
> < #endif
> < class TCPStream : public Socket, public streambuf, public iostream
> ---
> 
>> class TCPStream : public Socket, public std::streambuf, public std::iostream
> 
> 1365,1366c1363,1364
> < 	iostream *tcp(void)
> < 		{return ((iostream *)this);};
> ---
> 
>> 	std::iostream *tcp(void)
>> 		{return ((std::iostream *)this);};
> 
> 1563c1561
> < extern __EXPORT ::ostream &operator<<(::ostream &os, const InetAddress &ia);
> ---
> 
>> extern __EXPORT std::ostream &operator<<(std::ostream &os, const InetAddress &ia);
> 
> diff -r tmp/CommonC++-1.4.3/posix/url.cpp CommonC++-1.4.3/posix/url.cpp
> 51,52c51,52
> < #include <string.h>
> < #include <stdlib.h>
> ---
> 
>> #include <string>
>> #include <cstdlib>
> 
> 55c55
> < #include <iostream.h>
> ---
> 
>> #include <iostream>
> 
> 60c60
> < #include <strstream.h>
> ---
> 
>> #include <strstream>
> 
> 123c123
> < 			clear(ios::failbit | rdstate());
> ---
> 
>> 			clear(std::ios::failbit | rdstate());
> 
> 220c220
> < 	iostream::getline(buffer, size);
> ---
> 
>> 	std::iostream::getline(buffer, size);
> 
> 341c341
> < 	strstream str(buffer, sizeof(buffer), ios::out);
> ---
> 
>> 	std::strstream str(buffer, sizeof(buffer), std::ios::out);
> 
> 464c464
> <         str << "\r\n" << ends;
> ---
> 
>>         str << "\r\n" << std::ends;
> 
> diff -r tmp/CommonC++-1.4.3/posix/xml.cpp CommonC++-1.4.3/posix/xml.cpp
> 120,123c120,123
> < 	sax.startDocument = &saxStartDocument;
> < 	sax.endDocument = &saxEndDocument;
> < 	sax.startElement = &saxStartElement;
> < 	sax.endElement = &saxEndElement;
> ---
> 
>> 	sax.startDocument = (startDocumentSAXFunc)&saxStartDocument;
>> 	sax.endDocument = (endDocumentSAXFunc)&saxEndDocument;
>> 	sax.startElement = (startElementSAXFunc)&saxStartElement;
>> 	sax.endElement = (endElementSAXFunc)&saxEndElement;
> 
> Only in CommonC++-1.4.3: share
> Only in CommonC++-1.4.3/win32: Makefile
> diff -r tmp/CommonC++-1.4.3/win32/socket.h CommonC++-1.4.3/win32/socket.h
> 67c67
> < #include <iostream.h>
> ---
> 
>> #include <iostream>
> 
> 1280,1283c1280,1281
> < #ifdef	__KCC
> < using std::iostream;
> < #endif
> < class TCPStream : public Socket, public streambuf, public iostream
> ---
> 
>> class TCPStream : public Socket, public std::streambuf, public std::iostream
>> CommonC++-1.4.3-gcc3.diff
>> 
>> Content-Description:
>> 
>> fixes for gcc 3.0
>> Content-Type:
>> 
>> text/x-patch
>> 
>> 



From f.natter@ndh.net Fri Jun 22 16:25:33 2001
Received: from public.ndh.net ([195.94.90.21] helo=public.ndh.com)
	by fencepost.gnu.org with smtp (Exim 3.16 #1 (Debian))
	id 15DXUj-0006Fb-00
	for <bug-commoncpp@gnu.org>; Fri, 22 Jun 2001 16:25:33 -0400
Received: from 195.94.93.160 (port160.bonn.ndh.net [195.94.93.160]) by public.ndh.com (8.9.3/8.8.0) with ESMTP id WAA09716 for <bug-commoncpp@gnu.org>; Fri, 22 Jun 2001 22:25:30 +0200 (MET DST)
Received: (qmail 629 invoked by uid 1000); 22 Jun 2001 18:04:48 -0000
To: bug-commoncpp@gnu.org
Subject: [comp.lang.c++] Re: how to replace std::streambuf::setb(...) ?
From: Felix Natter <f.natter@ndh.net>
Date: 22 Jun 2001 20:04:48 +0200
Message-ID: <87r8wc5r27.fsf@mybaby.home.felix>
Lines: 64
User-Agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
Sender: bug-commoncpp-admin@gnu.org
Errors-To: bug-commoncpp-admin@gnu.org
X-BeenThere: bug-commoncpp@gnu.org
X-Mailman-Version: 2.0.5
Precedence: bulk
List-Help: <mailto:bug-commoncpp-request@gnu.org?subject=help>
List-Post: <mailto:bug-commoncpp@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=subscribe>
List-Id: Bug reports for Common C++ <bug-commoncpp.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=unsubscribe>
List-Archive: <http://mail.gnu.org/pipermail/bug-commoncpp/>

--=-=-=

hi,

how can I replace std::streambuf::setb(...) ?

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);
}

here is the reply from comp.lang.c++:


--=-=-=
Content-Type: message/rfc822
Content-Disposition: inline

Path: news.ndh.net!news.ubcom.net!newsfeed.germany.net!fu-berlin.de!uni-berlin.de!goethe.phaidros.COM!not-for-mail
From: Dietmar Kuehl <dietmar_kuehl@yahoo.com>
Newsgroups: comp.lang.c++
Subject: Re: how to replace std::streambuf::setb(...) ?
Date: Fri, 22 Jun 2001 21:19:25 +0200
Organization: Phaidros Software AG
Lines: 14
Message-ID: <3B339A3D.414A7402@yahoo.com>
References: <87zob2asa5.fsf@mybaby.home.felix>
NNTP-Posting-Host: goethe.phaidros.com (193.158.104.65)
X-Trace: fu-berlin.de 993229178 12085901 193.158.104.65 (16 [86292])
X-Mailer: Mozilla 4.74 [de] (X11; U; Linux 2.2.16 i686)
X-Accept-Language: en
Xref: news.ndh.net comp.lang.c++:509817
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii

Hi,
Felix Natter wrote:
> how can I replace std::streambuf::setb(...) ?

What is is it supposed to do? I would guess that it was used to
set up a put back area or something like this. I don't think
that you really need this because the calls to 'setg()' and
'setp()' are sufficient to deal with buffer management.

BTW, you can remoe the test for allocation failure, too: An
exception will be thrown ('std::bad_alloc') if allocation fails.
-- 
<mailto:dietmar_kuehl@yahoo.com> <http://www.dietmar-kuehl.de/>
Phaidros eaSE - Easy Software Engineering: <http://www.phaidros.com/>

--=-=-=



-- 
Felix Natter


--=-=-=--


From dyfet@ostel.com Fri Jun 22 18:24:41 2001
Received: from [63.124.177.154] (helo=home.sys)
	by fencepost.gnu.org with smtp (Exim 3.16 #1 (Debian))
	id 15DZLw-0002Hc-00
	for <bug-commoncpp@gnu.org>; Fri, 22 Jun 2001 18:24:36 -0400
Received: from ostel.com (home.sys [172.16.1.254])
	by home.sys (Postfix) with ESMTP
	id 3EAC4A0931; Fri, 22 Jun 2001 18:22:22 -0400 (EDT)
Message-ID: <3B33C51D.10504@ostel.com>
Date: Fri, 22 Jun 2001 18:22:21 -0400
From: David Sugar <dyfet@ostel.com>
Organization: OST
User-Agent: Mozilla/5.0 (X11; U; Linux 2.2.16-9mdk i686; en-US; m18) Gecko/20001013
X-Accept-Language: en
MIME-Version: 1.0
To: Felix Natter <f.natter@ndh.net>
Cc: bug-commoncpp@gnu.org
Subject: Re: fixes for gcc 3.0
References: <8766dofy21.fsf@mybaby.home.felix>
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
Sender: bug-commoncpp-admin@gnu.org
Errors-To: bug-commoncpp-admin@gnu.org
X-BeenThere: bug-commoncpp@gnu.org
X-Mailman-Version: 2.0.5
Precedence: bulk
List-Help: <mailto:bug-commoncpp-request@gnu.org?subject=help>
List-Post: <mailto:bug-commoncpp@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=subscribe>
List-Id: Bug reports for Common C++ <bug-commoncpp.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=unsubscribe>
List-Archive: <http://mail.gnu.org/pipermail/bug-commoncpp/>

I have improved upon this a little and I have gotten VC to also compile 
everything using the new stream headers rather than strstrea.h.  This is now 
all in cvs.

Felix Natter wrote:

> hi,
> 
> I attached a patch which makes Common-C++ 1.4.3 compilable with gcc 3.0.
> 
> - remove using-decls in headers (!)
> (you should never put a using-declaration in a header)
> - I added a std::-prefix even in *.cpp-files. If you want to, you
> can replace all these prefixes by doing this:
>         using std::cout;
>         using std::endl;
> or
>         using namespace std;
> but this can only be done in *.cpp-files (!)
> - header-file-fixes (e.g. <iostream.h>=><iostream>, <stdlib.h>=><cstdlib>)
> - socket.cpp,slog.h: <strstream> (or <strstream.h> or <strstrea.h>) don't seem
> to be used so I removed the #include's
> - socket.cpp,slog.cpp: remove std::iostream::init(this)/
> std::ostream::init(this) in favor of the corresponding std::iostream (or
> std::ostream..)-constructor (the empty std::iostream-constructor is not in
> the C++ standard)
> - socket.cpp,serial.cpp: missing std::streambuf::setb(...)
> => this is not in the C++ standard (gcc 3.0 does not provide it).
> I commented it out but I haven't yet found a "proper" solution
> (I posted to comp.lang.c++ but didn't yet get a reply)
> - add casts (e.g. startDocumentSAXFunc) in posix/xml.cpp
> - common/misc.h:
> In file included from mempager.cpp:45:
> misc.h:503: friend declaration requires class-key, i.e. `friend class 
>    StringTokenizer'
> misc.h:588: friend declaration requires class-key, i.e. `friend class 
>    StringTokenizer::iterator'
> - xmlfetch.cpp:59: buffer needs a cast to (char*)
> - demo/tcpthread.cpp: unsetf(
> => unsetf only accepts format-flags (gcc 2.95.x used unsigned long
> to represent format-flags and open-modes, so you never got an error
> until gcc 3.0, which uses enums, see below)
> here is the message I posted to comp.lang.c++ and the reply I got:
> "John Harrison" <jahhaj@bigfoot.com> writes:
> 
>> "Felix Natter" <f.natter@ndh.net> wrote in message
>> news:87u21aas9k.fsf@mybaby.home.felix...
>> 
>>> hi,
>>> 
>>> when compiling with gcc 3, I get the following error:
>>> 
>>> tcpthread.cpp: In constructor
>> 
>> `myTCPSession::myTCPSession(cc_TCPSocket&)':
>> 
>>> tcpthread.cpp:88: no matching function for call to
>> 
>> `myTCPSession::unsetf(const
>> 
>>>    std::_Ios_Openmode&)'
>>> /opt/gcc3/include/g++-v3/bits/ios_base.h:340: candidates are: void
>>>    std::ios_base::unsetf(std::_Ios_Fmtflags)
>>> 
>>> the code is this:
>>> 
>>> myTCPSession::myTCPSession(TCPSocket &server) :
>>> TCPSession(NULL, server)
>>> {
>>> std::cout << "creating session client object" << std::endl;
>>> mutex.EnterMutex();
>>> ++count;
>>> mutex.LeaveMutex();
>>>     unsetf(std::ios::binary);
>>> }
>>> 
>>> thanks,
>>> 
>>> --
>>> Felix Natter
>>> 
>> 
>> std::ios::binary isn't a format flag and can't be passed to unsetf. The
>> only place you can use std::ios::binary is when you open a stream.
>> 
>> john
> 
> 
> - all these changes make the code compilable with gcc 3.0, but demo/tcp*
> fail when compiling with gcc 3.0 (when compiling with gcc 2.95.3
> they seem to work just fine).
> Nevertheless I *believe* that the changes I made are correct, but some of
> your code must be non-standard. 
> If you want to track this down, you will have to set up gcc 3.0 as
> a secondary compiler (you should probably keep gcc 2.95.x around to make
> sure that the code remains compatible with it). If you need help with this,
> just tell me.
> 
> 
> 
> ------------------------------------------------------------------------
> 
> Only in tmp/CommonC++-1.4.3/: CommonC++.spec
> Only in CommonC++-1.4.3: bin
> Only in tmp/CommonC++-1.4.3/common: config.def
> diff -r tmp/CommonC++-1.4.3/common/digest.cpp CommonC++-1.4.3/common/digest.cpp
> 49c49
> < streambuf(), ostream()
> ---
> 
>> std::streambuf(), std::ostream(this)
> 
> 51d50
> < 	ostream::init((streambuf *)this);
> 78c77
> < ostream &ChecksumDigest::strDigest(ostream &os)
> ---
> 
>> std::ostream &ChecksumDigest::strDigest(std::ostream &os)
> 
> 116c115
> < ostream &CRC16Digest::strDigest(ostream &os)
> ---
> 
>> std::ostream &CRC16Digest::strDigest(std::ostream &os)
> 
> diff -r tmp/CommonC++-1.4.3/common/digest.h CommonC++-1.4.3/common/digest.h
> 52,53c52,53
> < #include <iostream.h>
> < #include <fstream.h>
> ---
> 
>> #include <iostream>
>> #include <fstream>
> 
> 58c58
> < #include <strstream.h>
> ---
> 
>> #include <strstream>
> 
> 71c71
> < class Digest : public streambuf, public ostream
> ---
> 
>> class Digest : public std::streambuf, public std::ostream
> 
> 109c109
> < 	virtual ostream &strDigest(ostream &os) = 0;
> ---
> 
>> 	virtual std::ostream &strDigest(std::ostream &os) = 0;
> 
> 111c111
> < 	friend ostream &operator<<(ostream &os, Digest &ia)
> ---
> 
>> 	friend std::ostream &operator<<(std::ostream &os, Digest &ia)
> 
> 128c128
> < 	ostream &strDigest(ostream &os);
> ---
> 
>> 	std::ostream &strDigest(std::ostream &os);
> 
> 157c157
> < 	ostream &strDigest(ostream &os);
> ---
> 
>> 	std::ostream &strDigest(std::ostream &os);
> 
> diff -r tmp/CommonC++-1.4.3/common/keydata.cpp CommonC++-1.4.3/common/keydata.cpp
> 41,42c41,42
> < #include <stdlib.h>
> < #include <string.h>
> ---
> 
>> #include <cstdlib>
>> #include <string>
> 
> 51c51
> < ifstream Keydata::cfgFile;
> ---
> 
>> std::ifstream Keydata::cfgFile;
> 
> 284c284
> < 		cfgFile.open(path, ios::in);
> ---
> 
>> 		cfgFile.open(path, std::ios::in);
> 
> 286c286
> < 			cfgFile.open(path + 5, ios::in);
> ---
> 
>> 			cfgFile.open(path + 5, std::ios::in);
> 
> diff -r tmp/CommonC++-1.4.3/common/misc.h CommonC++-1.4.3/common/misc.h
> 52c52
> < #include <fstream.h>
> ---
> 
>> #include <fstream>
> 
> 282c282
> < 	static ifstream cfgFile;
> ---
> 
>> 	static std::ifstream cfgFile;
> 
> 503c503
> < 		friend StringTokenizer;  // access our private constructors
> ---
> 
>> 		friend class StringTokenizer;  // access our private constructors
> 
> 588c588
> < 	friend iterator;
> ---
> 
>> 	friend class StringTokenizer::iterator;
> 
> diff -r tmp/CommonC++-1.4.3/common/persist.h CommonC++-1.4.3/common/persist.h
> 64c64
> < #include <iostream.h>
> ---
> 
>> #include <iostream>
> 
> 76,79d75
> < using std::string;
> < using std::map;
> < using std::vector;
> < 
> 83,84c79,80
> < 	__MEMBER_EXPORT PersistException(const string& reason);
> < 	__MEMBER_EXPORT const string& GetMessage() const;
> ---
> 
>> 	__MEMBER_EXPORT PersistException(const std::string& reason);
>> 	__MEMBER_EXPORT const std::string& GetMessage() const;
> 
> 87c83
> < 	string myMessage;
> ---
> 
>> 	std::string myMessage;
> 
> 116c112
> < 		string myName;
> ---
> 
>> 		std::string myName;
> 
> 136c132
> < 	typedef map<string,NewBaseObjectFunction> StringFunctionMap;
> ---
> 
>> 	typedef std::map<std::string,NewBaseObjectFunction> StringFunctionMap;
> 
> 236c232
> < 		Exception(const string &reason) : PersistException(reason) {}
> ---
> 
>> 		Exception(const std::string &reason) : PersistException(reason) {}
> 
> 253c249
> < 	__MEMBER_EXPORT Engine(iostream& stream, EngineMode mode) THROWS (PersistException);
> ---
> 
>> 	__MEMBER_EXPORT Engine(std::iostream& stream, EngineMode mode) THROWS (PersistException);
> 
> 280c276
> < 	void Write(const string& str) THROWS (Exception);
> ---
> 
>> 	void Write(const std::string& str) THROWS (Exception);
> 
> 300c296
> < 	void Read(string& str) THROWS (Exception);
> ---
> 
>> 	void Read(std::string& str) THROWS (Exception);
> 
> 308c304
> < 	iostream& myUnderlyingStream;
> ---
> 
>> 	std::iostream& myUnderlyingStream;
> 
> 318,321c314,317
> < 	typedef vector<BaseObject*>           ArchiveVector;
> < 	typedef map<BaseObject const*, int32> ArchiveMap;
> < 	typedef vector<string>                ClassVector;
> < 	typedef map<string, int32>            ClassMap;
> ---
> 
>> 	typedef std::vector<BaseObject*>           ArchiveVector;
>> 	typedef std::map<BaseObject const*, int32> ArchiveMap;
>> 	typedef std::vector<std::string>                ClassVector;
>> 	typedef std::map<std::string, int32>            ClassMap;
> 
> 371,372c367,368
> < __EXPORT Engine& operator >>( Engine& ar, string& ob) THROWS (Engine::Exception);
> < __EXPORT Engine& operator <<( Engine& ar, string ob)  THROWS (Engine::Exception);
> ---
> 
>> __EXPORT Engine& operator >>( Engine& ar, std::string& ob) THROWS (Engine::Exception);
>> __EXPORT Engine& operator <<( Engine& ar, std::string ob)  THROWS (Engine::Exception);
> 
> 386c382
> < Engine& operator <<( Engine& ar, vector<T> const& ob) THROWS (Engine::Exception)
> ---
> 
>> Engine& operator <<( Engine& ar, std::vector<T> const& ob) THROWS (Engine::Exception)
> 
> 399c395
> < Engine& operator >>( Engine& ar, vector<T>& ob) THROWS (Engine::Exception)
> ---
> 
>> Engine& operator >>( Engine& ar, std::vector<T>& ob) THROWS (Engine::Exception)
> 
> 415c411
> < Engine& operator <<( Engine& ar, map<Key,Value> const & ob) THROWS (Engine::Exception)
> ---
> 
>> Engine& operator <<( Engine& ar, std::map<Key,Value> const & ob) THROWS (Engine::Exception)
> 
> 418c414
> < 	for(map<Key,Value>::const_iterator it = ob.begin();it != ob.end();++it)
> ---
> 
>> 	for(std::map<Key,Value>::const_iterator it = ob.begin();it != ob.end();++it)
> 
> 428c424
> < Engine& operator >>( Engine& ar, map<Key,Value>& ob) THROWS (Engine::Exception)
> ---
> 
>> Engine& operator >>( Engine& ar, std::map<Key,Value>& ob) THROWS (Engine::Exception)
> 
> diff -r tmp/CommonC++-1.4.3/demo/bug1.cpp CommonC++-1.4.3/demo/bug1.cpp
> 52,53c52,53
> < 	void Run() { cout << "Run()..." << endl;};
> < 	void Final() { cout << "Final()..." << endl; delete this;};
> ---
> 
>> 	void Run() { std::cout << "Run()..." << std::endl;};
>> 	void Final() { std::cout << "Final()..." << std::endl; delete this;};
> 
> 59c59
> < 	cout << "before start()..." << endl;
> ---
> 
>> 	std::cout << "before start()..." << std::endl;
> 
> 62c62
> < 	cout << "exiting..." << endl;
> ---
> 
>> 	std::cout << "exiting..." << std::endl;
> 
> diff -r tmp/CommonC++-1.4.3/demo/cmdlineopt.cpp CommonC++-1.4.3/demo/cmdlineopt.cpp
> 115c115
> < 		cerr << args->PrintUsage();
> ---
> 
>> 		std::cerr << args->PrintUsage();
> 
> 121,122c121,122
> < 		cerr << args->PrintErrors();
> < 		cerr << args->PrintUsage();
> ---
> 
>> 		std::cerr << args->PrintErrors();
>> 		std::cerr << args->PrintUsage();
> 
> 131c131,132
> < 		cerr << "test_option1 = " << test_option1.values[ i ] << endl;
> ---
> 
>> 		std::cerr << "test_option1 = " << test_option1.values[ i ] 
>> 			  << std::endl;
> 
> 136c137,138
> < 		cerr << "restoargs " << i << " : " << restoargs.values[ i ] << endl;
> ---
> 
>> 		std::cerr << "restoargs " << i << " : " << restoargs.values[i]
>> 			  << std::endl;
> 
> 161,162c163,164
> < #include <string.h>
> < #include <stdlib.h>
> ---
> 
>> #include <string>
>> #include <cstdlib>
> 
> 201c203
> < 				strstream msg;
> ---
> 
>> 				std::strstream msg;
> 
> 233c235
> < 			cerr
> ---
> 
>> 			std::cerr
> 
> 293c295
> < 		cerr << args->PrintUsage();
> ---
> 
>> 		std::cerr << args->PrintUsage();
> 
> 299,300c301,302
> < 		cerr << args->PrintErrors();
> < 		cerr << "Get help by --help\n";
> ---
> 
>> 		std::cerr << args->PrintErrors();
>> 		std::cerr << "Get help by --help\n";
> 
> 308c310,311
> < 		cerr << "test_file = " << test_file.values[ i ] << endl;
> ---
> 
>> 		std::cerr << "test_file = " << test_file.values[ i ]
>> 			  << std::endl;
> 
> 312c315,316
> < 		cerr << "test_restoargs " << i << " : " << test_restoargs.values[ i ] << endl;
> ---
> 
>> 		std::cerr << "test_restoargs " << i << " : "
>> 			  << test_restoargs.values[ i ] << std::endl;
> 
> diff -r tmp/CommonC++-1.4.3/demo/serialecho.cpp CommonC++-1.4.3/demo/serialecho.cpp
> 59c59
> <   cout << "Creating SerialEcho" << endl;
> ---
> 
>>   std::cout << "Creating SerialEcho" << std::endl;
> 
> 65c65
> <     cout << "modem ready" << endl;
> ---
> 
>>     std::cout << "modem ready" << std::endl;
> 
> 70,74c70,74
> <   if (setSpeed(38400)) cout << getErrorString() << endl;
> <   if (setCharBits(8)) cout << getErrorString() << endl;
> <   if (setParity(SERIAL_PARITY_NONE)) cout << getErrorString() << endl;
> <   if (setStopBits(1)) cout << getErrorString() << endl;
> <   if (setFlowControl(SERIAL_FLOW_HARD)) cout << getErrorString() << endl;
> ---
> 
>>   if (setSpeed(38400)) std::cout << getErrorString() << std::endl;
>>   if (setCharBits(8)) std::cout << getErrorString() << std::endl;
>>   if (setParity(SERIAL_PARITY_NONE)) std::cout << getErrorString() <<std::endl;
>>   if (setStopBits(1)) std::cout << getErrorString() << std::endl;
>>   if (setFlowControl(SERIAL_FLOW_HARD)) std::cout<<getErrorString()<<std::endl;
> 
> 76c76
> <   cout << "config done" << endl;
> ---
> 
>>   std::cout << "config done" << std::endl;
> 
> 80c80
> <   cout << "polling method call" << endl;
> ---
> 
>>   std::cout << "polling method call" << std::endl;
> 
> 85c85
> <   cout << "polling method call" << endl;
> ---
> 
>>   std::cout << "polling method call" << std::endl;
> 
> 92c92
> <   cout << "start monitor" << endl;
> ---
> 
>>   std::cout << "start monitor" << std::endl;
> 
> 96c96
> <       cout.put( get() );
> ---
> 
>>       std::cout.put( get() );
> 
> 101c101
> <   cout << "end of monitor" << endl;
> ---
> 
>>   std::cout << "end of monitor" << std::endl;
> 
> diff -r tmp/CommonC++-1.4.3/demo/serialmain.cpp CommonC++-1.4.3/demo/serialmain.cpp
> 58c58
> <   cout << "Serial Echo to TCP Sessions" << endl;
> ---
> 
>>   std::cout << "Serial Echo to TCP Sessions" << std::endl;
> 
> 63c63
> <     cout << "Modem Error; aborting" << endl;
> ---
> 
>>     std::cout << "Modem Error; aborting" << std::endl;
> 
> 66c66
> <     cout << "Serial Error: " 
> ---
> 
>>     std::cout << "Serial Error: " 
> 
> 69c69
> <          << endl;
> ---
> 
>>          << std::endl;
> 
> 75c75
> <   cout << "Modem code:" << modem->Start() << endl;
> ---
> 
>>   std::cout << "Modem code:" << modem->Start() << std::endl;
> 
> 77c77
> <   while (cin >> b, b[0]) {
> ---
> 
>>   while (std::cin >> b, b[0]) {
> 
> 79c79
> <     *modem << b << "\r" << endl;
> ---
> 
>>     *modem << b << "\r" << std::endl;
> 
> 81c81
> <     cout << "sent: " << b << endl;
> ---
> 
>>     std::cout << "sent: " << b << std::endl;
> 
> 85c85
> <   cout << "fin" << endl;
> ---
> 
>>   std::cout << "fin" << std::endl;
> 
> diff -r tmp/CommonC++-1.4.3/demo/tcp.cpp CommonC++-1.4.3/demo/tcp.cpp
> 45,46c45,46
> < #include <iostream.h>
> < #include <stdlib.h>
> ---
> 
>> #include <iostream>
>> #include <cstdlib>
> 
> 61c61
> < 	cout << "accepting from: " << ia << ":" << port << endl;;
> ---
> 
>> 	std::cout << "accepting from: " << ia << ":" << port << std::endl;
> 
> 71c71
> < 	cout << "testing addr: " << addr << ":" << 4096 << endl;
> ---
> 
>> 	std::cout << "testing addr: " << addr << ":" << 4096 << std::endl;
> 
> 74c74
> < 	cout << "binding for: " << addr << ":" << 4096 << endl;
> ---
> 
>> 	std::cout << "binding for: " << addr << ":" << 4096 << std::endl;
> 
> 83c83
> < 			tcp << "welcome to " << addr << endl;
> ---
> 
>> 			tcp << "welcome to " << addr << std::endl;
> 
> 87c87
> < 				tcp << "user entered " << i << endl;
> ---
> 
>> 				tcp << "user entered " << i << std::endl;
> 
> 89c89
> < 			tcp << "exiting now" << endl;
> ---
> 
>> 			tcp << "exiting now" << std::endl;
> 
> 97,98c97,100
> < 		cerr << "socket error " << saddr << ":" << port << endl; 
> < 		cout << "error number " << socket->getErrorNumber() << endl;		
> ---
> 
>> 		std::cerr << "socket error " << saddr << ":" << port
>> 			  << std::endl; 
>> 		std::cout << "error number " << socket->getErrorNumber()
>> 			  << std::endl;		
> 
> 101c103
> < 			cerr << "bind failed; no resources" << endl;
> ---
> 
>> 		        std::cerr << "bind failed; no resources" << std::endl;
> 
> 106c108
> < 			cerr << "bind failed; port busy" << endl;
> ---
> 
>> 			std::cerr << "bind failed; port busy" << std::endl;
> 
> 110c112,113
> < 	cout << "timeout after 30 seconds inactivity, exiting" << endl;
> ---
> 
>> 	std::cout << "timeout after 30 seconds inactivity, exiting"
>> 		  << std::endl;
> 
> diff -r tmp/CommonC++-1.4.3/demo/tcpservice.cpp CommonC++-1.4.3/demo/tcpservice.cpp
> 35c35
> < #include <iostream.h>
> ---
> 
>> #include <iostream>
> 
> 49c49
> < typedef ::list<ts_list_item *> ts_list;
> ---
> 
>> typedef std::list<ts_list_item *> ts_list;
> 
> 149c149
> < 	cerr << "ChatterSession deleted !\n";
> ---
> 
>> 	std::cerr << "ChatterSession deleted !\n";
> 
> 162c162
> < 	cerr << "ChatterSession Created\n";
> ---
> 
>> 	std::cerr << "ChatterSession Created\n";
> 
> 167,168c167,168
> < 	cerr << "connecting from " << ia.getHostname() <<
> < 	":" << port << endl;
> ---
> 
>> 	std::cerr << "connecting from " << ia.getHostname()
>> 		  << ":" << port << std::endl;
> 
> 185c185
> < 	cerr << "ChatterSession Expired\n";
> ---
> 
>> 	std::cerr << "ChatterSession Expired\n";
> 
> 198c198
> < 	cerr << "Pending called\n";
> ---
> 
>> 	std::cerr << "Pending called\n";
> 
> 207,209c207,209
> < 		cerr << "Read '";
> < 		cerr.write( buf, len );
> < 		cerr << "'\n";
> ---
> 
>> 		std::cerr << "Read '";
>> 		std::cerr.write( buf, len );
>> 		std::cerr << "'\n";
> 
> 247c247
> < 	    cerr << "Socket port write sent an exception !\n";
> ---
> 
>> 	    std::cerr << "Socket port write sent an exception !\n";
> 
> 256c256
> < 	cerr << "ChatterSession disconnected!\n";
> ---
> 
>> 	std::cerr << "ChatterSession disconnected!\n";
> 
> 322c322
> < 		cerr << "ChatterSession create failed\n";
> ---
> 
>> 		std::cerr << "ChatterSession create failed\n";
> 
> 368c368
> < 	cerr << "machine is not address" << endl;
> ---
> 
>> 	std::cerr << "machine is not address" << std::endl;
> 
> 371c371
> <     cerr << "machine is " << machine.getHostname() << endl;
> ---
> 
>>     std::cerr << "machine is " << machine.getHostname() << std::endl;
> 
> 385c385
> < 	cerr << "Failed to bind\n";
> ---
> 
>> 	std::cerr << "Failed to bind\n";
> 
> diff -r tmp/CommonC++-1.4.3/demo/tcpthread.cpp CommonC++-1.4.3/demo/tcpthread.cpp
> 72c72,73
> < 	cout << "accepting from: " << ia.getHostname() << ":" << port << endl;;
> ---
> 
>> 	std::cout << "accepting from: " << ia.getHostname() << ":" << port
>> 		  << std::endl;;
> 
> 83c84
> < 	cout << "creating session client object" << endl;
> ---
> 
>> 	std::cout << "creating session client object" << std::endl;
> 
> 87c88
> < 	unsetf(ios::binary);
> ---
> 
>> 	//TODO:!!        unsetf(std::ios::binary);
> 
> 93c94,95
> < 	*tcp() << "welcome to " << addr.getHostname() << " from socket " << so << endl;
> ---
> 
>> 	*tcp() << "welcome to " << addr.getHostname() << " from socket " 
>> 	       << so << std::endl;
> 
> 95c97
> < 	*tcp() << "called from thread " << count << endl;
> ---
> 
>> 	*tcp() << "called from thread " << count << std::endl;
> 
> 98c100
> < 	*tcp() << "ending session" << endl;
> ---
> 
>> 	*tcp() << "ending session" << std::endl;
> 
> 111c113,114
> < 	cout << "testing addr: " << addr.getHostname() << ":" << 4096 << endl;
> ---
> 
>> 	std::cout << "testing addr: " << addr.getHostname() << ":" << 4096
>> 		  << std::endl;
> 
> 113c116,117
> < 	cout << "binding for: " << addr.getHostname() << ":" << 4096 << endl;
> ---
> 
>> 	std::cout << "binding for: " << addr.getHostname() << ":" << 4096
>> 	     << std::endl;
> 
> 121c125
> < 			cout << "before create" << endl;
> ---
> 
>> 			std::cout << "before create" << std::endl;
> 
> 123c127
> < 			cout << "after create" << endl;
> ---
> 
>> 			std::cout << "after create" << std::endl;
> 
> 132c136,137
> < 		cerr << "socket error " << saddr.getHostname() << ":" << port << " = " << err << endl; 
> ---
> 
>> 		std::cerr << "socket error " << saddr.getHostname()
>> 			  << ":" << port << " = " << err << std::endl; 
> 
> 135c140
> < 			cerr << "bind failed; port busy" << endl;
> ---
> 
>> 			std::cerr << "bind failed; port busy" << std::endl;
> 
> 139c144
> < 			cerr << "client socket failed" << endl;
> ---
> 
>> 			std::cerr << "client socket failed" << std::endl;
> 
> 141c146,147
> < 	cout << "timeout after 30 seconds inactivity, exiting" << endl;
> ---
> 
>> 	std::cout << "timeout after 30 seconds inactivity, exiting"
>> 		  << std::endl;
> 
> diff -r tmp/CommonC++-1.4.3/demo/urlfetch.cpp CommonC++-1.4.3/demo/urlfetch.cpp
> 45,46c45,46
> < #include <iostream.h>
> < #include <stdlib.h>
> ---
> 
>> #include <iostream>
>> #include <cstdlib>
> 
> 53c53
> < 		cout << "HEADER " << header << "=" << value << endl;
> ---
> 
>> 		std::cout << "HEADER " << header << "=" << value << std::endl;
> 
> 70c70
> < 			cout << "fetching " << *argv << endl;
> ---
> 
>> 			std::cout << "fetching " << *argv << std::endl;
> 
> 74c74,75
> < 				cout << "failed; reason=" << status << endl;
> ---
> 
>> 				std::cout << "failed; reason=" << status 
>> 					  << std::endl;
> 
> 78c79
> < 			cout << "loading..." << endl;
> ---
> 
>> 			std::cout << "loading..." << std::endl;
> 
> 84c85
> < 					cout.write(cbuf, len);
> ---
> 
>> 					std::cout.write(cbuf, len);
> 
> 86c87
> < //				cout << cbuf << endl;
> ---
> 
>> //				std::cout << cbuf << std::endl;
> 
> 89c90
> < 			cout << ends;
> ---
> 
>> 			std::cout << std::ends;
> 
> 94c95
> < 		cerr << "url " << *argv << " failed" << endl;
> ---
> 
>> 		std::cerr << "url " << *argv << " failed" << std::endl;
> 
> diff -r tmp/CommonC++-1.4.3/demo/xmlfetch.cpp CommonC++-1.4.3/demo/xmlfetch.cpp
> 46,47c46,47
> < #include <iostream.h>
> < #include <stdlib.h>
> ---
> 
>> #include <iostream>
>> #include <cstdlib>
> 
> 59c59
> < 		read(buffer, len);
> ---
> 
>> 		read((char*)buffer, len);
> 
> Only in CommonC++-1.4.3/doc: Makefile
> Only in CommonC++-1.4.3/freebsd: Makefile
> Only in CommonC++-1.4.3/m4: Makefile
> Only in tmp/CommonC++-1.4.3/posix: ccgnu-config
> diff -r tmp/CommonC++-1.4.3/posix/cmdoptns.cpp CommonC++-1.4.3/posix/cmdoptns.cpp
> 53,54c53,54
> < #include <stdlib.h>
> < #include <iostream.h>
> ---
> 
>> #include <cstdlib>
>> #include <iostream>
> 
> Only in tmp/CommonC++-1.4.3/posix: config.h
> Only in CommonC++-1.4.3/posix: config.tmp
> diff -r tmp/CommonC++-1.4.3/posix/fifo.cpp CommonC++-1.4.3/posix/fifo.cpp
> 50c50
> < fstream()
> ---
> 
>> std::fstream()
> 
> 56c56
> < fstream()
> ---
> 
>> std::fstream()
> 
> 69c69
> < 	fstream::close();
> ---
> 
>> 	std::fstream::close();
> 
> 87c87
> < 	fstream::open(fname, ios::in | ios::out);
> ---
> 
>> 	std::fstream::open(fname, std::ios::in | std::ios::out);
> 
> 99c99
> < 	fstream()
> ---
> 
>> 	std::fstream()
> 
> 111c111
> < 	open(fname, ios::in | ios::out);
> ---
> 
>> 	open(fname, std::ios::in | std::ios::out);
> 
> diff -r tmp/CommonC++-1.4.3/posix/file.h CommonC++-1.4.3/posix/file.h
> 52c52
> < #include <stdio.h>
> ---
> 
>> #include <cstdio>
> 
> 56,57c56,57
> < #include <iostream.h>
> < #include <fstream.h>
> ---
> 
>> #include <iostream>
>> #include <fstream>
> 
> 147c147
> < class fifostream : public fstream
> ---
> 
>> class fifostream : public std::fstream
> 
> 190c190
> < class FIFOSession : public Thread, public fstream
> ---
> 
>> class FIFOSession : public Thread, public std::fstream
> 
> diff -r tmp/CommonC++-1.4.3/posix/serial.cpp CommonC++-1.4.3/posix/serial.cpp
> 502c502
> < Serial(filename), streambuf(), iostream()
> ---
> 
>> Serial(filename), std::streambuf(), std::iostream(this)
> 
> 504d503
> < 	iostream::init((streambuf *)this);
> 511,513c510
> < Serial(), streambuf(), iostream()
> < {
> < 	iostream::init((streambuf *)this);
> ---
> 
>> Serial(), std::streambuf(), std::iostream(this){
> 
> 561,563c558,560
> < #if !(defined(STLPORT) || defined(__KCC))
> < 	setb(gbuf, gbuf + bufsize, 0);
> < #endif
> ---
> 
>> 	//#if !(defined(STLPORT) || defined(__KCC))
>> 	//	setb(gbuf, gbuf + bufsize, 0);
>> 	//#endif
> 
> 591,593c588,590
> < #if !(defined(STLPORT) || defined(__KCC))
> < 		setb(0,0);
> < #endif
> ---
> 
>> 		//#if !(defined(STLPORT) || defined(__KCC))
>> 		//		setb(0,0);
>> 		//#endif
> 
> 614c611
> < 				clear(ios::failbit | rdstate());
> ---
> 
>> 				clear(std::ios::failbit | rdstate());
> 
> 642c639
> < 			clear(ios::failbit | rdstate());
> ---
> 
>> 			clear(std::ios::failbit | rdstate());
> 
> 676c673
> < 				clear(ios::failbit | rdstate());
> ---
> 
>> 				clear(std::ios::failbit | rdstate());
> 
> 693c690
> < 				clear(ios::failbit | rdstate());
> ---
> 
>> 				clear(std::ios::failbit | rdstate());
> 
> diff -r tmp/CommonC++-1.4.3/posix/serial.h CommonC++-1.4.3/posix/serial.h
> 52c52
> < #include <iostream.h>
> ---
> 
>> #include <iostream>
> 
> 378c378
> < class TTYStream : public streambuf, public iostream, public Serial
> ---
> 
>> class TTYStream : public std::streambuf, public std::iostream, public Serial
> 
> diff -r tmp/CommonC++-1.4.3/posix/slog.cpp CommonC++-1.4.3/posix/slog.cpp
> 50c50
> < streambuf(), ostream()
> ---
> 
>> std::streambuf(), std::ostream(this)
> 
> 52d51
> < 	ostream::init((streambuf *)this);
> 110c109
> < 			clog << thread->_msgbuf << endl;
> ---
> 
>> 			std::clog << thread->_msgbuf << std::endl;
> 
> diff -r tmp/CommonC++-1.4.3/posix/slog.h CommonC++-1.4.3/posix/slog.h
> 52,53c52
> < #include <iostream.h>
> < #include <strstream.h>
> ---
> 
>> #include <iostream>
> 
> 93c92
> < class Slog : public streambuf, public ostream
> ---
> 
>> class Slog : public std::streambuf, public std::ostream
> 
> diff -r tmp/CommonC++-1.4.3/posix/socket.cpp CommonC++-1.4.3/posix/socket.cpp
> 53c53
> < #include <strstream.h>
> ---
> 
>> //#include <strstream>
> 
> 55c55
> < #include <strstrea.h>
> ---
> 
>> //#include <strstrea.h>
> 
> 791,792c791,792
> < 	,streambuf() 
> < 	,iostream()
> ---
> 
>> 	,std::streambuf() 
>> 	,std::iostream(this)
> 
> 797d796
> < 	iostream::init((streambuf *)this);
> 804c803
> < 		clear(ios::failbit | rdstate());
> ---
> 
>> 		clear(std::ios::failbit | rdstate());
> 
> 814c813
> < 	streambuf(), iostream(),
> ---
> 
>> 	std::streambuf(), std::iostream(this),
> 
> 817,818d815
> < 	iostream::init((streambuf *)this);
> < 
> 850c847
> < 	streambuf(), iostream(), bufsize(0),gbuf(NULL),pbuf(NULL)
> ---
> 
>> 	std::streambuf(), std::iostream(this), bufsize(0),gbuf(NULL),pbuf(NULL)
> 
> 852d848
> < 	iostream::init((streambuf *)this);
> 857c853
> < 	Socket(source.so), streambuf(), iostream() 
> ---
> 
>> 	Socket(source.so), std::streambuf(), std::iostream(this) 
> 
> 859c855
> < 	Socket(dup(source.so)), streambuf(), iostream() 
> ---
> 
>> 	Socket(dup(source.so)), std::streambuf(), std::iostream(this) 
> 
> 862d857
> < 	iostream::init((streambuf *)this);
> 894c889
> < 	setb(gbuf, gbuf + size, 0);
> ---
> 
>> 	//	setb(gbuf, gbuf + size, 0);
> 
> 935c930
> < 				clear(ios::failbit | rdstate());
> ---
> 
>> 				clear(std::ios::failbit | rdstate());
> 
> 955c950
> < 			clear(ios::failbit | rdstate());
> ---
> 
>> 			clear(std::ios::failbit | rdstate());
> 
> 997c992
> < 				clear(ios::failbit | rdstate());
> ---
> 
>> 				clear(std::ios::failbit | rdstate());
> 
> 1017c1012
> < 				clear(ios::failbit | rdstate());
> ---
> 
>> 				clear(std::ios::failbit | rdstate());
> 
> 1076c1071
> < 		clear(ios::failbit | rdstate());
> ---
> 
>> 		clear(std::ios::failbit | rdstate());
> 
> 1088,1092c1083,1087
> < 		clog << "### Wrong OnAccept() signature! Overwrite \n"
> < 		     << "\tbool OnAccept(const InetHostAddress &ia,\n"
> < 		     << "\t              tpport_t port);\n"
> < 		     << "\tThis OnAccept() does not work anymore.\n"
> < 		     << "\t(short changed to tpport_t)" << endl;
> ---
> 
>> 		std::clog << "### Wrong OnAccept() signature! Overwrite \n"
>> 			  << "\tbool OnAccept(const InetHostAddress &ia,\n"
>> 			  << "\t              tpport_t port);\n"
>> 			  << "\tThis OnAccept() does not work anymore.\n"
>> 			  << "\t(short changed to tpport_t)" << std::endl;
> 
> 1226c1221
> < ostream &operator<<(ostream &os, const InetAddress &ia)
> ---
> 
>> std::ostream &operator<<(std::ostream &os, const InetAddress &ia)
> 
> diff -r tmp/CommonC++-1.4.3/posix/socket.h CommonC++-1.4.3/posix/socket.h
> 67c67
> < #include <iostream.h>
> ---
> 
>> #include <iostream>
> 
> 1280,1283c1280,1281
> < #ifdef	__KCC
> < using std::iostream;
> < #endif
> < class TCPStream : public Socket, public streambuf, public iostream
> ---
> 
>> class TCPStream : public Socket, public std::streambuf, public std::iostream
> 
> 1365,1366c1363,1364
> < 	iostream *tcp(void)
> < 		{return ((iostream *)this);};
> ---
> 
>> 	std::iostream *tcp(void)
>> 		{return ((std::iostream *)this);};
> 
> 1563c1561
> < extern __EXPORT ::ostream &operator<<(::ostream &os, const InetAddress &ia);
> ---
> 
>> extern __EXPORT std::ostream &operator<<(std::ostream &os, const InetAddress &ia);
> 
> diff -r tmp/CommonC++-1.4.3/posix/url.cpp CommonC++-1.4.3/posix/url.cpp
> 51,52c51,52
> < #include <string.h>
> < #include <stdlib.h>
> ---
> 
>> #include <string>
>> #include <cstdlib>
> 
> 55c55
> < #include <iostream.h>
> ---
> 
>> #include <iostream>
> 
> 60c60
> < #include <strstream.h>
> ---
> 
>> #include <strstream>
> 
> 123c123
> < 			clear(ios::failbit | rdstate());
> ---
> 
>> 			clear(std::ios::failbit | rdstate());
> 
> 220c220
> < 	iostream::getline(buffer, size);
> ---
> 
>> 	std::iostream::getline(buffer, size);
> 
> 341c341
> < 	strstream str(buffer, sizeof(buffer), ios::out);
> ---
> 
>> 	std::strstream str(buffer, sizeof(buffer), std::ios::out);
> 
> 464c464
> <         str << "\r\n" << ends;
> ---
> 
>>         str << "\r\n" << std::ends;
> 
> diff -r tmp/CommonC++-1.4.3/posix/xml.cpp CommonC++-1.4.3/posix/xml.cpp
> 120,123c120,123
> < 	sax.startDocument = &saxStartDocument;
> < 	sax.endDocument = &saxEndDocument;
> < 	sax.startElement = &saxStartElement;
> < 	sax.endElement = &saxEndElement;
> ---
> 
>> 	sax.startDocument = (startDocumentSAXFunc)&saxStartDocument;
>> 	sax.endDocument = (endDocumentSAXFunc)&saxEndDocument;
>> 	sax.startElement = (startElementSAXFunc)&saxStartElement;
>> 	sax.endElement = (endElementSAXFunc)&saxEndElement;
> 
> Only in CommonC++-1.4.3: share
> Only in CommonC++-1.4.3/win32: Makefile
> diff -r tmp/CommonC++-1.4.3/win32/socket.h CommonC++-1.4.3/win32/socket.h
> 67c67
> < #include <iostream.h>
> ---
> 
>> #include <iostream>
> 
> 1280,1283c1280,1281
> < #ifdef	__KCC
> < using std::iostream;
> < #endif
> < class TCPStream : public Socket, public streambuf, public iostream
> ---
> 
>> class TCPStream : public Socket, public std::streambuf, public std::iostream
>> CommonC++-1.4.3-gcc3.diff
>> 
>> Content-Description:
>> 
>> fixes for gcc 3.0
>> Content-Type:
>> 
>> text/x-patch
>> 
>> 



From V.Haisman@sh.cvut.cz Mon Jun 25 04:20:23 2001
Received: from service.sh.cvut.cz ([147.32.127.214])
	by fencepost.gnu.org with esmtp (Exim 3.16 #1 (Debian))
	id 15ERbb-0005tA-00
	for <bug-commoncpp@gnu.org>; Mon, 25 Jun 2001 04:20:23 -0400
Received: from logout.sh.cvut.cz (logout.sh.cvut.cz [147.32.127.203])
	by service.sh.cvut.cz (8.9.3/SH) with ESMTP id MAA08935
	for <bug-commoncpp@gnu.org>; Mon, 25 Jun 2001 12:08:39 +0200
Received: from logout.sh.cvut.cz (logout.sh.cvut.cz [147.32.127.203])
	by logout.sh.cvut.cz (8.9.3/8.9.2) with ESMTP id KAA43450
	for <bug-commoncpp@gnu.org>; Mon, 25 Jun 2001 10:20:20 +0200 (CEST)
	(envelope-from wilx@logout.sh.cvut.cz)
Date: Mon, 25 Jun 2001 10:20:19 +0200 (CEST)
From: Vaclav Haisman <V.Haisman@sh.cvut.cz>
To: bug-commoncpp@gnu.org
Subject: another Semaphore patch
Message-ID: <Pine.BSF.4.05.10106251015180.43154-200000@logout.sh.cvut.cz>
MIME-Version: 1.0
Content-Type: MULTIPART/MIXED; BOUNDARY="0-248065832-993457219=:43154"
Sender: bug-commoncpp-admin@gnu.org
Errors-To: bug-commoncpp-admin@gnu.org
X-BeenThere: bug-commoncpp@gnu.org
X-Mailman-Version: 2.0.5
Precedence: bulk
List-Help: <mailto:bug-commoncpp-request@gnu.org?subject=help>
List-Post: <mailto:bug-commoncpp@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=subscribe>
List-Id: Bug reports for Common C++ <bug-commoncpp.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=unsubscribe>
List-Archive: <http://mail.gnu.org/pipermail/bug-commoncpp/>

  This message is in MIME format.  The first part should be readable text,
  while the remaining parts are likely unreadable without MIME-aware tools.
  Send mail to mime@docserver.cac.washington.edu for more info.

--0-248065832-993457219=:43154
Content-Type: TEXT/PLAIN; charset=US-ASCII


Hi, 

I tryed to compile demo and it failed becuse of undefined reference to
sem_getvalue(). This was caused by Semaphore::getValue() not being inside
#ifdef _SYSV_SEMAPHORES block and haveing only Posix version implemented.
The patch fixes it. I also moved definition of _SYSV_SEMAPHORES before
inclusion of semaphores.h and made the inclusion conditional with
_SYSV_SEMAPHORES. The change in initializers is to get rid of warning:
aggregate has a partly bracketed initializer.


Vaclav Haisman

--0-248065832-993457219=:43154
Content-Type: TEXT/PLAIN; charset=US-ASCII; name="moresemaphores.diff"
Content-Transfer-Encoding: BASE64
Content-ID: <Pine.BSF.4.05.10106251020190.43154@logout.sh.cvut.cz>
Content-Description: 
Content-Disposition: attachment; filename="moresemaphores.diff"

SW5kZXg6IHNlbWFwaG9yZS5jcHANCj09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0N
ClJDUyBmaWxlOiAvY3Zzcm9vdC9jcGx1c3BsdXMvQ29tbW9uQysrL3Bvc2l4
L3NlbWFwaG9yZS5jcHAsdg0KcmV0cmlldmluZyByZXZpc2lvbiAxLjkNCmRp
ZmYgLWMgLXIxLjkgc2VtYXBob3JlLmNwcA0KKioqIHNlbWFwaG9yZS5jcHAJ
MjAwMS8wNi8yMyAxMjo0MjoxNwkxLjkNCi0tLSBzZW1hcGhvcmUuY3BwCTIw
MDEvMDYvMjQgMTM6MzE6MjcNCioqKioqKioqKioqKioqKg0KKioqIDc2LDEw
MCAqKioqDQogIA0KICB2b2lkIFNlbWFwaG9yZTo6V2FpdCh2b2lkKQ0KICB7
DQohIAlzdHJ1Y3Qgc2VtYnVmIG9wc1tdID0gezAsIC0xLCAwfTsNCiAgCQ0K
ICAJc2Vtb3AoX3NlbWFwaG9yZSwgb3BzLCAxKTsNCiAgfQ0KICANCiAgYm9v
bCBTZW1hcGhvcmU6OlRyeVdhaXQodm9pZCkNCiAgew0KISAJc3RydWN0IHNl
bWJ1ZiBvcHNbXSA9IHswLCAtMSwgSVBDX05PV0FJVH07DQogIAkNCiAgCXJl
dHVybiAoc2Vtb3AoX3NlbWFwaG9yZSwgb3BzLCAxKSA9PSBFQUdBSU4pID8g
ZmFsc2UgOiB0cnVlOw0KICB9DQogIA0KICB2b2lkIFNlbWFwaG9yZTo6UG9z
dCh2b2lkKQ0KICB7DQohIAlzdHJ1Y3Qgc2VtYnVmIG9wc1tdID0gezAsIDEs
IDB9Ow0KICANCiAgCXNlbW9wKF9zZW1hcGhvcmUsIG9wcywgMSk7DQogIH0N
CiAgDQogICNlbHNlDQogIA0KICBTZW1hcGhvcmU6OlNlbWFwaG9yZShzaXpl
X3QgcmVzb3VyY2UpIA0KLS0tIDc2LDEwNSAtLS0tDQogIA0KICB2b2lkIFNl
bWFwaG9yZTo6V2FpdCh2b2lkKQ0KICB7DQohIAlzdHJ1Y3Qgc2VtYnVmIG9w
c1tdID0ge3swLCAtMSwgMH19Ow0KICAJDQogIAlzZW1vcChfc2VtYXBob3Jl
LCBvcHMsIDEpOw0KICB9DQogIA0KICBib29sIFNlbWFwaG9yZTo6VHJ5V2Fp
dCh2b2lkKQ0KICB7DQohIAlzdHJ1Y3Qgc2VtYnVmIG9wc1tdID0ge3swLCAt
MSwgSVBDX05PV0FJVH19Ow0KICAJDQogIAlyZXR1cm4gKHNlbW9wKF9zZW1h
cGhvcmUsIG9wcywgMSkgPT0gRUFHQUlOKSA/IGZhbHNlIDogdHJ1ZTsNCiAg
fQ0KICANCiAgdm9pZCBTZW1hcGhvcmU6OlBvc3Qodm9pZCkNCiAgew0KISAJ
c3RydWN0IHNlbWJ1ZiBvcHNbXSA9IHt7MCwgMSwgMH19Ow0KICANCiAgCXNl
bW9wKF9zZW1hcGhvcmUsIG9wcywgMSk7DQogIH0NCiAgDQorIGludCBTZW1h
cGhvcmU6OmdldFZhbHVlKHZvaWQpDQorIHsNCisgCXJldHVybiBzZW1jdGwo
X3NlbWFwaG9yZSwwLEdFVFZBTCk7DQorIH0NCisgDQogICNlbHNlDQogIA0K
ICBTZW1hcGhvcmU6OlNlbWFwaG9yZShzaXplX3QgcmVzb3VyY2UpIA0KKioq
KioqKioqKioqKioqDQoqKiogMTA0LDExMSAqKioqDQogIAkJCXRocm93KHRo
aXMpOw0KICB9DQogIA0KLSAjZW5kaWYNCi0gDQogICNpZmRlZglfX2xpbnV4
X18NCiAgDQogIFNlbWFwaG9yZTo6flNlbWFwaG9yZSgpDQotLS0gMTA5LDEx
NCAtLS0tDQoqKioqKioqKioqKioqKioNCioqKiAxMjgsMTQxICoqKioNCiAg
CXJldHVybiAoc2VtX3RyeXdhaXQoJl9zZW1hcGhvcmUpID09IDApID8gdHJ1
ZSA6IGZhbHNlOw0KICB9DQogIA0KLSAjZW5kaWYNCi0gDQogIGludCBTZW1h
cGhvcmU6OmdldFZhbHVlKHZvaWQpDQogIHsNCiAgCWludCB2YWx1ZTsNCiAg
CXNlbV9nZXR2YWx1ZSgmX3NlbWFwaG9yZSwgJnZhbHVlKTsNCiAgCXJldHVy
biB2YWx1ZTsNCiAgfQ0KICANCiAgLyoqIEVNQUNTICoqDQogICAqIExvY2Fs
IHZhcmlhYmxlczoNCi0tLSAxMzEsMTQ1IC0tLS0NCiAgCXJldHVybiAoc2Vt
X3RyeXdhaXQoJl9zZW1hcGhvcmUpID09IDApID8gdHJ1ZSA6IGZhbHNlOw0K
ICB9DQogIA0KICBpbnQgU2VtYXBob3JlOjpnZXRWYWx1ZSh2b2lkKQ0KICB7
DQogIAlpbnQgdmFsdWU7DQogIAlzZW1fZ2V0dmFsdWUoJl9zZW1hcGhvcmUs
ICZ2YWx1ZSk7DQogIAlyZXR1cm4gdmFsdWU7DQogIH0NCisgDQorICNlbmRp
Zg0KKyAjZW5kaWYNCiAgDQogIC8qKiBFTUFDUyAqKg0KICAgKiBMb2NhbCB2
YXJpYWJsZXM6DQpJbmRleDogdGhyZWFkLmgNCj09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT0NClJDUyBmaWxlOiAvY3Zzcm9vdC9jcGx1c3BsdXMvQ29tbW9uQysr
L3Bvc2l4L3RocmVhZC5oLHYNCnJldHJpZXZpbmcgcmV2aXNpb24gMS4zMw0K
ZGlmZiAtYyAtcjEuMzMgdGhyZWFkLmgNCioqKiB0aHJlYWQuaAkyMDAxLzA2
LzIyIDE4OjM4OjE5CTEuMzMNCi0tLSB0aHJlYWQuaAkyMDAxLzA2LzI0IDEz
OjMxOjI4DQoqKioqKioqKioqKioqKioNCioqKiA2MSw3MCAqKioqDQotLS0g
NjEsNzYgLS0tLQ0KICAjaW5jbHVkZSA8Y2MrKy9jb25maWcuaD4NCiAgI2Vu
ZGlmDQogIA0KKyAjaWYgZGVmaW5lZChfX0ZyZWVCU0RfXykgJiYgX19GcmVl
QlNEX18gPD0gMw0KKyAjZGVmaW5lCV9TWVNWX1NFTUFQSE9SRVMNCisgI2Vu
ZGlmDQorIA0KICAjaWZuZGVmCUhBVkVfUFRIUkVBRF9IDQogICNpbmNsdWRl
IDxwdGhyZWFkLmg+DQorICNpZm5kZWYgX1NZU1ZfU0VNQVBIT1JFUw0KICAj
aW5jbHVkZSA8c2VtYXBob3JlLmg+DQogICNlbmRpZg0KKyAjZW5kaWYNCiAg
DQogICNpZm5kZWYJX19DQ1hYX01BQ1JPU19IX18NCiAgI2luY2x1ZGUgPGNj
KysvbWFjcm9zLmg+DQoqKioqKioqKioqKioqKioNCioqKiA3OCw4NyAqKioq
DQogICNpbmNsdWRlIDxzaWduYWwuaD4NCiAgI2luY2x1ZGUgPHNldGptcC5o
Pg0KICAjaW5jbHVkZSA8dW5pc3RkLmg+DQotIA0KLSAjaWYgZGVmaW5lZChf
X0ZyZWVCU0RfXykgJiYgX19GcmVlQlNEX18gPD0gMw0KLSAjZGVmaW5lCV9T
WVNWX1NFTUFQSE9SRVMNCi0gI2VuZGlmDQogIA0KICAjaWZkZWYJX19saW51
eF9fDQogICNkZWZpbmUgX1NJR19USFJFQURfU1RPUENPTlQNCi0tLSA4NCw4
OSAtLS0tDQo=
--0-248065832-993457219=:43154--


From dyfet@ostel.com Mon Jun 25 09:09:48 2001
Received: from [63.124.177.154] (helo=home.sys)
	by fencepost.gnu.org with smtp (Exim 3.16 #1 (Debian))
	id 15EW7f-0001AR-00
	for <bug-commoncpp@gnu.org>; Mon, 25 Jun 2001 09:09:48 -0400
Received: from ostel.com (home.sys [172.16.1.254])
	by home.sys (Postfix) with ESMTP
	id 5B09EA2B5E; Mon, 25 Jun 2001 09:07:55 -0400 (EDT)
Message-ID: <3B3737AB.30703@ostel.com>
Date: Mon, 25 Jun 2001 09:07:55 -0400
From: David Sugar <dyfet@ostel.com>
Organization: OST
User-Agent: Mozilla/5.0 (X11; U; Linux 2.2.16-9mdk i686; en-US; m18) Gecko/20001013
X-Accept-Language: en
MIME-Version: 1.0
To: Vaclav Haisman <V.Haisman@sh.cvut.cz>
Cc: bug-commoncpp@gnu.org
Subject: Re: another Semaphore patch
References: <Pine.BSF.4.05.10106251015180.43154-200000@logout.sh.cvut.cz>
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
Sender: bug-commoncpp-admin@gnu.org
Errors-To: bug-commoncpp-admin@gnu.org
X-BeenThere: bug-commoncpp@gnu.org
X-Mailman-Version: 2.0.5
Precedence: bulk
List-Help: <mailto:bug-commoncpp-request@gnu.org?subject=help>
List-Post: <mailto:bug-commoncpp@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=subscribe>
List-Id: Bug reports for Common C++ <bug-commoncpp.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=unsubscribe>
List-Archive: <http://mail.gnu.org/pipermail/bug-commoncpp/>

I happened to like this change request when I first saw it submitted, because 
it was simple to add and allowed Common C++ to be used on older FreeBSD 
releases.  I changed it a bit from the original to get it out of the headers, 
though I didn't have a FreeBSD target to test my changes with.

David

Vaclav Haisman wrote:

> Hi, 
> 
> I tryed to compile demo and it failed becuse of undefined reference to
> sem_getvalue(). This was caused by Semaphore::getValue() not being inside
> #ifdef _SYSV_SEMAPHORES block and haveing only Posix version implemented.
> The patch fixes it. I also moved definition of _SYSV_SEMAPHORES before
> inclusion of semaphores.h and made the inclusion conditional with
> _SYSV_SEMAPHORES. The change in initializers is to get rid of warning:
> aggregate has a partly bracketed initializer.
> 
> 
> Vaclav Haisman
> 
> 
> ------------------------------------------------------------------------
> 
> Index: semaphore.cpp
> ===================================================================
> RCS file: /cvsroot/cplusplus/CommonC++/posix/semaphore.cpp,v
> retrieving revision 1.9
> diff -c -r1.9 semaphore.cpp
> *** semaphore.cpp	2001/06/23 12:42:17	1.9
> --- semaphore.cpp	2001/06/24 13:31:27
> ***************
> *** 76,100 ****
>   
>   void Semaphore::Wait(void)
>   {
> ! 	struct sembuf ops[] = {0, -1, 0};
>   	
>   	semop(_semaphore, ops, 1);
>   }
>   
>   bool Semaphore::TryWait(void)
>   {
> ! 	struct sembuf ops[] = {0, -1, IPC_NOWAIT};
>   	
>   	return (semop(_semaphore, ops, 1) == EAGAIN) ? false : true;
>   }
>   
>   void Semaphore::Post(void)
>   {
> ! 	struct sembuf ops[] = {0, 1, 0};
>   
>   	semop(_semaphore, ops, 1);
>   }
>   
>   #else
>   
>   Semaphore::Semaphore(size_t resource) 
> --- 76,105 ----
>   
>   void Semaphore::Wait(void)
>   {
> ! 	struct sembuf ops[] = {{0, -1, 0}};
>   	
>   	semop(_semaphore, ops, 1);
>   }
>   
>   bool Semaphore::TryWait(void)
>   {
> ! 	struct sembuf ops[] = {{0, -1, IPC_NOWAIT}};
>   	
>   	return (semop(_semaphore, ops, 1) == EAGAIN) ? false : true;
>   }
>   
>   void Semaphore::Post(void)
>   {
> ! 	struct sembuf ops[] = {{0, 1, 0}};
>   
>   	semop(_semaphore, ops, 1);
>   }
>   
> + int Semaphore::getValue(void)
> + {
> + 	return semctl(_semaphore,0,GETVAL);
> + }
> + 
>   #else
>   
>   Semaphore::Semaphore(size_t resource) 
> ***************
> *** 104,111 ****
>   			throw(this);
>   }
>   
> - #endif
> - 
>   #ifdef	__linux__
>   
>   Semaphore::~Semaphore()
> --- 109,114 ----
> ***************
> *** 128,141 ****
>   	return (sem_trywait(&_semaphore) == 0) ? true : false;
>   }
>   
> - #endif
> - 
>   int Semaphore::getValue(void)
>   {
>   	int value;
>   	sem_getvalue(&_semaphore, &value);
>   	return value;
>   }
>   
>   /** EMACS **
>    * Local variables:
> --- 131,145 ----
>   	return (sem_trywait(&_semaphore) == 0) ? true : false;
>   }
>   
>   int Semaphore::getValue(void)
>   {
>   	int value;
>   	sem_getvalue(&_semaphore, &value);
>   	return value;
>   }
> + 
> + #endif
> + #endif
>   
>   /** EMACS **
>    * Local variables:
> Index: thread.h
> ===================================================================
> RCS file: /cvsroot/cplusplus/CommonC++/posix/thread.h,v
> retrieving revision 1.33
> diff -c -r1.33 thread.h
> *** thread.h	2001/06/22 18:38:19	1.33
> --- thread.h	2001/06/24 13:31:28
> ***************
> *** 61,70 ****
> --- 61,76 ----
>   #include <cc++/config.h>
>   #endif
>   
> + #if defined(__FreeBSD__) && __FreeBSD__ <= 3
> + #define	_SYSV_SEMAPHORES
> + #endif
> + 
>   #ifndef	HAVE_PTHREAD_H
>   #include <pthread.h>
> + #ifndef _SYSV_SEMAPHORES
>   #include <semaphore.h>
>   #endif
> + #endif
>   
>   #ifndef	__CCXX_MACROS_H__
>   #include <cc++/macros.h>
> ***************
> *** 78,87 ****
>   #include <signal.h>
>   #include <setjmp.h>
>   #include <unistd.h>
> - 
> - #if defined(__FreeBSD__) && __FreeBSD__ <= 3
> - #define	_SYSV_SEMAPHORES
> - #endif
>   
>   #ifdef	__linux__
>   #define _SIG_THREAD_STOPCONT
> --- 84,89 ----
> moresemaphores.diff
> 
> Content-Type:
> 
> TEXT/PLAIN
> Content-Encoding:
> 
> BASE64



From adam@yggdrasil.com Tue Jun 26 01:46:14 2001
Received: from freya.yggdrasil.com ([209.249.10.20] helo=ns1.yggdrasil.com)
	by fencepost.gnu.org with esmtp (Exim 3.16 #1 (Debian))
	id 15Elfy-0000GA-00
	for <bug-commoncpp@gnu.org>; Tue, 26 Jun 2001 01:46:14 -0400
Received: from baldur.yggdrasil.com (baldur.yggdrasil.com [209.249.10.12])
	by ns1.yggdrasil.com (8.9.3/8.9.3) with ESMTP id WAA07936;
	Mon, 25 Jun 2001 22:46:12 -0700
From: "Adam J. Richter" <adam@yggdrasil.com>
Received: (from adam@localhost)
	by baldur.yggdrasil.com (8.9.3/8.9.3) id WAA27056;
	Mon, 25 Jun 2001 22:46:12 -0700
Date: Mon, 25 Jun 2001 22:46:12 -0700
Message-Id: <200106260546.WAA27056@baldur.yggdrasil.com>
To: bug-commoncpp@gnu.org
Subject: PATCH: CommonC++-1.4.3/posix/ccgnu-config.in accomodation for gcc-3.0
Sender: bug-commoncpp-admin@gnu.org
Errors-To: bug-commoncpp-admin@gnu.org
X-BeenThere: bug-commoncpp@gnu.org
X-Mailman-Version: 2.0.5
Precedence: bulk
List-Help: <mailto:bug-commoncpp-request@gnu.org?subject=help>
List-Post: <mailto:bug-commoncpp@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=subscribe>
List-Id: Bug reports for Common C++ <bug-commoncpp.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=unsubscribe>
List-Archive: <http://mail.gnu.org/pipermail/bug-commoncpp/>

	gcc-3.0, and, therefore, g++-3.0, generally chokes on -I/usr/include
(search for "-I/usr/include" in gcc-3.0/gcc/doc/gcc.texi for details).
The following patch changes to CommonC++/posix/ccgnu-config.in to
accomodate this quirk.

	I think a number of source code changes will also be necessary
to appease gcc-3.0, but this should get things to the point where the
error messages are usually sensible.

Adam J. Richter     __     ______________   4880 Stevens Creek Blvd, Suite 104
adam@yggdrasil.com     \ /                  San Jose, California 95129-1034
+1 408 261-6630         | g g d r a s i l   United States of America
fax +1 408 261-6631      "Free Software For The Rest Of Us."
------------------------------CUT HERE---------------------------------
--- CommonC++-1.4.3/posix/ccgnu-config.in	Wed Mar 28 13:26:34 2001
+++ CommonC++/posix/ccgnu-config.in	Mon Jun 25 22:30:14 2001
@@ -7,7 +7,11 @@
 prefix="@prefix@"
 exec_prefix="@exec_prefix@"
 libdir="-L@libdir@"
-includedir="-I@includedir@"
+if test "@includedir@" = "/usr/include" ; then
+	includedir=""
+else
+	includedir="-I@includedir@"
+fi
 
 usage()
 {


From seenutn@cdotb.ernet.in Tue Jun 26 02:29:22 2001
Received: from [202.41.72.121] (helo=ws9.cdotb.ernet.in)
	by fencepost.gnu.org with esmtp (Exim 3.16 #1 (Debian))
	id 15EmLc-0001MJ-00
	for <bug-commoncpp@gnu.org>; Tue, 26 Jun 2001 02:29:19 -0400
Received: from ws9.cdotb.ernet.in (IDENT:seenutn@[192.168.51.218])
	by ws9.cdotb.ernet.in (8.9.3/8.9.3) with ESMTP id LAA16031
	for <bug-commoncpp@gnu.org>; Tue, 26 Jun 2001 11:48:47 +0500 (GMT+0500)
Message-ID: <3B382C98.7070709@ws9.cdotb.ernet.in>
Date: Tue, 26 Jun 2001 12:02:56 +0530
From: "Srinivasa T.N." <seenutn@cdotb.ernet.in>
Organization: C-DOT
User-Agent: Mozilla/5.0 (X11; U; Linux 2.2.14-5.0 i686; en-US; m18) Gecko/20010131 Netscape6/6.01
X-Accept-Language: en
MIME-Version: 1.0
To: bug-commoncpp <bug-commoncpp@gnu.org>
Subject: Common C++ and ecos
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
Sender: bug-commoncpp-admin@gnu.org
Errors-To: bug-commoncpp-admin@gnu.org
X-BeenThere: bug-commoncpp@gnu.org
X-Mailman-Version: 2.0.5
Precedence: bulk
List-Help: <mailto:bug-commoncpp-request@gnu.org?subject=help>
List-Post: <mailto:bug-commoncpp@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=subscribe>
List-Id: Bug reports for Common C++ <bug-commoncpp.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=unsubscribe>
List-Archive: <http://mail.gnu.org/pipermail/bug-commoncpp/>

Hi All,
   Has anybody ported Common C++  to eCos??  If not, what are the steps 
taken to port it to eCos??  (eCos supports POSIX Calls and we use a 
gcc-2.95.2 to crosscompile executable, host is linux)......

Regards,
Seenu.

-- 
-----------------------------------------------------------------------------
If not here, you can reach me at seenutn@seenutn.org

C-DOT, 71/1, Sneha Complex, Miller Road, Bangalore - 560 052
Ph: 226 3399 Ext: 268/Direct: 238 3951 (Off)   363 1707 (Resi)
	http://www.seenutn.org



From dyfet@ostel.com Tue Jun 26 06:42:29 2001
Received: from [63.124.177.154] (helo=home.sys)
	by fencepost.gnu.org with smtp (Exim 3.16 #1 (Debian))
	id 15EqIe-0003hA-00
	for <bug-commoncpp@gnu.org>; Tue, 26 Jun 2001 06:42:29 -0400
Received: from ostel.com (home.sys [172.16.1.254])
	by home.sys (Postfix) with ESMTP
	id B9D8BA040B; Tue, 26 Jun 2001 06:40:43 -0400 (EDT)
Message-ID: <3B3866AB.2020604@ostel.com>
Date: Tue, 26 Jun 2001 06:40:43 -0400
From: David Sugar <dyfet@ostel.com>
Organization: OST
User-Agent: Mozilla/5.0 (X11; U; Linux 2.2.16-9mdk i686; en-US; m18) Gecko/20001013
X-Accept-Language: en
MIME-Version: 1.0
To: "Adam J. Richter" <adam@yggdrasil.com>
Cc: bug-commoncpp@gnu.org
Subject: Re: PATCH: CommonC++-1.4.3/posix/ccgnu-config.in accomodation for gcc-3.0
References: <200106260546.WAA27056@baldur.yggdrasil.com>
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
Sender: bug-commoncpp-admin@gnu.org
Errors-To: bug-commoncpp-admin@gnu.org
X-BeenThere: bug-commoncpp@gnu.org
X-Mailman-Version: 2.0.5
Precedence: bulk
List-Help: <mailto:bug-commoncpp-request@gnu.org?subject=help>
List-Post: <mailto:bug-commoncpp@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=subscribe>
List-Id: Bug reports for Common C++ <bug-commoncpp.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=unsubscribe>
List-Archive: <http://mail.gnu.org/pipermail/bug-commoncpp/>

Actually, what will be the new 1.5 release (I hope to get it out this week) 
has lots of changes for compiling under gcc 3.0, but this is the first I heard 
of this specific quirk...hmm...I will add this in.

Adam J. Richter wrote:

> 	gcc-3.0, and, therefore, g++-3.0, generally chokes on -I/usr/include
> (search for "-I/usr/include" in gcc-3.0/gcc/doc/gcc.texi for details).
> The following patch changes to CommonC++/posix/ccgnu-config.in to
> accomodate this quirk.
> 
> 	I think a number of source code changes will also be necessary
> to appease gcc-3.0, but this should get things to the point where the
> error messages are usually sensible.
> 
> Adam J. Richter     __     ______________   4880 Stevens Creek Blvd, Suite 104
> adam@yggdrasil.com     \ /                  San Jose, California 95129-1034
> +1 408 261-6630         | g g d r a s i l   United States of America
> fax +1 408 261-6631      "Free Software For The Rest Of Us."
> ------------------------------CUT HERE---------------------------------
> --- CommonC++-1.4.3/posix/ccgnu-config.in	Wed Mar 28 13:26:34 2001
> +++ CommonC++/posix/ccgnu-config.in	Mon Jun 25 22:30:14 2001
> @@ -7,7 +7,11 @@
>  prefix="@prefix@"
>  exec_prefix="@exec_prefix@"
>  libdir="-L@libdir@"
> -includedir="-I@includedir@"
> +if test "@includedir@" = "/usr/include" ; then
> +	includedir=""
> +else
> +	includedir="-I@includedir@"
> +fi
>  
>  usage()
>  {
> 
> _______________________________________________
> Bug-commoncpp mailing list
> Bug-commoncpp@gnu.org
> http://mail.gnu.org/mailman/listinfo/bug-commoncpp



From V.Haisman@sh.cvut.cz Tue Jun 26 17:55:33 2001
Received: from service.sh.cvut.cz ([147.32.127.214])
	by fencepost.gnu.org with esmtp (Exim 3.16 #1 (Debian))
	id 15F0o1-0005sq-00
	for <bug-commoncpp@gnu.org>; Tue, 26 Jun 2001 17:55:33 -0400
Received: from logout.sh.cvut.cz (logout.sh.cvut.cz [147.32.127.203])
	by service.sh.cvut.cz (8.9.3/SH) with ESMTP id XAA11297
	for <bug-commoncpp@gnu.org>; Tue, 26 Jun 2001 23:55:17 +0200
Received: from logout.sh.cvut.cz (logout.sh.cvut.cz [147.32.127.203])
	by logout.sh.cvut.cz (8.9.3/8.9.2) with ESMTP id XAA81039
	for <bug-commoncpp@gnu.org>; Tue, 26 Jun 2001 23:55:30 +0200 (CEST)
	(envelope-from wilx@logout.sh.cvut.cz)
Date: Tue, 26 Jun 2001 23:55:30 +0200 (CEST)
From: Vaclav Haisman <V.Haisman@sh.cvut.cz>
To: bug-commoncpp@gnu.org
Subject: return some value in Thread::Detach()
Message-ID: <Pine.BSF.4.05.10106262348240.72926-100000@logout.sh.cvut.cz>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
Sender: bug-commoncpp-admin@gnu.org
Errors-To: bug-commoncpp-admin@gnu.org
X-BeenThere: bug-commoncpp@gnu.org
X-Mailman-Version: 2.0.5
Precedence: bulk
List-Help: <mailto:bug-commoncpp-request@gnu.org?subject=help>
List-Post: <mailto:bug-commoncpp@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=subscribe>
List-Id: Bug reports for Common C++ <bug-commoncpp.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=unsubscribe>
List-Archive: <http://mail.gnu.org/pipermail/bug-commoncpp/>

Hi,
this patch makes Thread::Detach return some value.

There is another thing:
thread.cpp: In member function `void cc_Thread::setTimer(long unsigned
int)':
thread.cpp:435: warning: statement with no effect

The line 435 is:         _arm;
I think there is probably something missing.


The patch:
Index: thread.cpp
===================================================================
RCS file: /cvsroot/cplusplus/CommonC++/posix/thread.cpp,v
retrieving revision 1.34
diff -c -r1.34 thread.cpp
*** thread.cpp  2001/06/22 14:47:12     1.34
--- thread.cpp  2001/06/26 21:54:29
***************
*** 307,314 ****

        _start = start;
        rtn = pthread_create(&_tid, &_attr, exec_t(&execHandler), this);
!       if(!rtn && _tid)
                pthread_detach(_tid);
  }

  void Thread::Terminate(void)
--- 307,318 ----

        _start = start;
        rtn = pthread_create(&_tid, &_attr, exec_t(&execHandler), this);
!       if(!rtn && _tid) {
                pthread_detach(_tid);
+                 return 0;
+         }
+         else
+                 return -1;
  }

  void Thread::Terminate(void)





From seenutn@cdotb.ernet.in Wed Jun 27 00:01:24 2001
Received: from [202.41.72.121] (helo=ws9.cdotb.ernet.in)
	by fencepost.gnu.org with esmtp (Exim 3.16 #1 (Debian))
	id 15F6W3-0006SE-00
	for <bug-commoncpp@gnu.org>; Wed, 27 Jun 2001 00:01:23 -0400
Received: from ws9.cdotb.ernet.in (IDENT:seenutn@[192.168.51.218])
	by ws9.cdotb.ernet.in (8.9.3/8.9.3) with ESMTP id JAA24071
	for <bug-commoncpp@gnu.org>; Wed, 27 Jun 2001 09:21:07 +0500 (GMT+0500)
Message-ID: <3B395B7A.6080702@ws9.cdotb.ernet.in>
Date: Wed, 27 Jun 2001 09:35:14 +0530
From: "Srinivasa T.N." <seenutn@cdotb.ernet.in>
Organization: C-DOT
User-Agent: Mozilla/5.0 (X11; U; Linux 2.2.14-5.0 i686; en-US; m18) Gecko/20010131 Netscape6/6.01
X-Accept-Language: en
MIME-Version: 1.0
To: bug-commoncpp <bug-commoncpp@gnu.org>
Subject: Porting??
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
Sender: bug-commoncpp-admin@gnu.org
Errors-To: bug-commoncpp-admin@gnu.org
X-BeenThere: bug-commoncpp@gnu.org
X-Mailman-Version: 2.0.5
Precedence: bulk
List-Help: <mailto:bug-commoncpp-request@gnu.org?subject=help>
List-Post: <mailto:bug-commoncpp@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=subscribe>
List-Id: Bug reports for Common C++ <bug-commoncpp.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=unsubscribe>
List-Archive: <http://mail.gnu.org/pipermail/bug-commoncpp/>

Hi David and others,

   Can anyone suggest about what all files should I look into/do changes 
for porting Common C++ to new platform??

Regards,
Seenu.

-- 
-----------------------------------------------------------------------------
If not here, you can reach me at seenutn@seenutn.org

C-DOT, 71/1, Sneha Complex, Miller Road, Bangalore - 560 052
Ph: 226 3399 Ext: 268/Direct: 238 3951 (Off)   363 1707 (Resi)
	http://www.seenutn.org



From V.Haisman@sh.cvut.cz Wed Jun 27 06:46:04 2001
Received: from service.sh.cvut.cz ([147.32.127.214])
	by fencepost.gnu.org with esmtp (Exim 3.16 #1 (Debian))
	id 15FCpf-0004z6-00
	for <bug-commoncpp@gnu.org>; Wed, 27 Jun 2001 06:46:03 -0400
Received: from logout.sh.cvut.cz (logout.sh.cvut.cz [147.32.127.203])
	by service.sh.cvut.cz (8.9.3/SH) with ESMTP id MAA09374
	for <bug-commoncpp@gnu.org>; Wed, 27 Jun 2001 12:45:35 +0200
Received: from logout.sh.cvut.cz (logout.sh.cvut.cz [147.32.127.203])
	by logout.sh.cvut.cz (8.9.3/8.9.2) with ESMTP id MAA20651
	for <bug-commoncpp@gnu.org>; Wed, 27 Jun 2001 12:45:59 +0200 (CEST)
	(envelope-from wilx@logout.sh.cvut.cz)
Date: Wed, 27 Jun 2001 12:45:59 +0200 (CEST)
From: Vaclav Haisman <V.Haisman@sh.cvut.cz>
To: bug-commoncpp@gnu.org
Subject: PATCH: change order of initializers in constructors of TTYStream
 class
Message-ID: <Pine.BSF.4.05.10106271237050.19897-100000@logout.sh.cvut.cz>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
Sender: bug-commoncpp-admin@gnu.org
Errors-To: bug-commoncpp-admin@gnu.org
X-BeenThere: bug-commoncpp@gnu.org
X-Mailman-Version: 2.0.5
Precedence: bulk
List-Help: <mailto:bug-commoncpp-request@gnu.org?subject=help>
List-Post: <mailto:bug-commoncpp@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=subscribe>
List-Id: Bug reports for Common C++ <bug-commoncpp.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=unsubscribe>
List-Archive: <http://mail.gnu.org/pipermail/bug-commoncpp/>

Hi,

this patch changes order initializers in constructors of TTYStream class
so that we don't get warnings like:

/home/4/wilx/include/g++-v3/bits/std_iosfwd.h: In
constructor `TTYStream::TTYStream(const char*)':
/home/4/wilx/include/g++-v3/bits/std_iosfwd.h:59: warning:
base initializers for `class std::basic_iostream<char,
std::char_traits<char> >'
serial.h:126: warning:   and `class cc_Serial'
serial.cpp:506: warning:   will be re-ordered to match
inheritance order

Vaclav Haisman


The patch:

Index: serial.cpp
===================================================================
RCS file: /cvsroot/cplusplus/CommonC++/posix/serial.cpp,v
retrieving revision 1.50
diff -u -r1.50 serial.cpp
--- serial.cpp  2001/06/26 16:36:51     1.50
+++ serial.cpp  2001/06/27 10:43:17
@@ -502,7 +502,7 @@
 }

 TTYStream::TTYStream(const char *filename) :
-Serial(filename), streambuf(), iostream((streambuf *)this)
+streambuf(), iostream((streambuf *)this), Serial(filename)
 {
        gbuf = pbuf = NULL;
        timeout = 0;
@@ -511,7 +511,7 @@
 }

 TTYStream::TTYStream() :
-Serial(), streambuf(), iostream((streambuf *)this)
+streambuf(), iostream((streambuf *)this), Serial()
 {
        timeout = 0;
        gbuf = pbuf = NULL;




From V.Haisman@sh.cvut.cz Wed Jun 27 07:02:42 2001
Received: from service.sh.cvut.cz ([147.32.127.214])
	by fencepost.gnu.org with esmtp (Exim 3.16 #1 (Debian))
	id 15FD5l-0005Rr-00
	for <bug-commoncpp@gnu.org>; Wed, 27 Jun 2001 07:02:41 -0400
Received: from logout.sh.cvut.cz (logout.sh.cvut.cz [147.32.127.203])
	by service.sh.cvut.cz (8.9.3/SH) with ESMTP id NAA10368
	for <bug-commoncpp@gnu.org>; Wed, 27 Jun 2001 13:02:15 +0200
Received: from logout.sh.cvut.cz (logout.sh.cvut.cz [147.32.127.203])
	by logout.sh.cvut.cz (8.9.3/8.9.2) with ESMTP id NAA21248
	for <bug-commoncpp@gnu.org>; Wed, 27 Jun 2001 13:02:40 +0200 (CEST)
	(envelope-from wilx@logout.sh.cvut.cz)
Date: Wed, 27 Jun 2001 13:02:39 +0200 (CEST)
From: Vaclav Haisman <V.Haisman@sh.cvut.cz>
To: bug-commoncpp@gnu.org
Subject: change all ios:: to ios_base:: ???
Message-ID: <Pine.BSF.4.05.10106271259030.19897-100000@logout.sh.cvut.cz>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
Sender: bug-commoncpp-admin@gnu.org
Errors-To: bug-commoncpp-admin@gnu.org
X-BeenThere: bug-commoncpp@gnu.org
X-Mailman-Version: 2.0.5
Precedence: bulk
List-Help: <mailto:bug-commoncpp-request@gnu.org?subject=help>
List-Post: <mailto:bug-commoncpp@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=subscribe>
List-Id: Bug reports for Common C++ <bug-commoncpp.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=unsubscribe>
List-Archive: <http://mail.gnu.org/pipermail/bug-commoncpp/>

Shouln't be all occurrences of ios:: changed to ios_base:: ??

Vaclav Haisman



From adam@yggdrasil.com Thu Jun 28 21:13:32 2001
Received: from ns1.yggdrasil.com ([209.249.10.20])
	by fencepost.gnu.org with esmtp (Exim 3.16 #1 (Debian))
	id 15Fmqh-0001rZ-00; Thu, 28 Jun 2001 21:13:32 -0400
Received: from baldur.yggdrasil.com (baldur.yggdrasil.com [209.249.10.12])
	by ns1.yggdrasil.com (8.9.3/8.9.3) with ESMTP id SAA23832;
	Thu, 28 Jun 2001 18:13:30 -0700
Received: (from adam@localhost)
	by baldur.yggdrasil.com (8.9.3/8.9.3) id SAA00513;
	Thu, 28 Jun 2001 18:13:30 -0700
Date: Thu, 28 Jun 2001 18:13:30 -0700
From: "Adam J. Richter" <adam@yggdrasil.com>
To: bug-commoncpp@gnu.org
Cc: autoconf@gnu.org
Subject: PATCH: CommonC++-1.50/m4 vs. autoconf-2.50
Message-ID: <20010628181330.A502@baldur.yggdrasil.com>
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="u3/rZRmxL6MmkK24"
Content-Disposition: inline
User-Agent: Mutt/1.2i
Sender: bug-commoncpp-admin@gnu.org
Errors-To: bug-commoncpp-admin@gnu.org
X-BeenThere: bug-commoncpp@gnu.org
X-Mailman-Version: 2.0.5
Precedence: bulk
List-Help: <mailto:bug-commoncpp-request@gnu.org?subject=help>
List-Post: <mailto:bug-commoncpp@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=subscribe>
List-Id: Bug reports for Common C++ <bug-commoncpp.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=unsubscribe>
List-Archive: <http://mail.gnu.org/pipermail/bug-commoncpp/>

--u3/rZRmxL6MmkK24
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline


	Under autoconf-2.50, the AC_CHECK_LIB(mylib,mysymbol) macro
builds shell variables with names like "$ac_cv_mylib_mysymbol".  If a
couple of files in the CommonC++-2.50/m4/ directory, you use a shell
variable for "mylib", like so:

	 AC_CHECK_LIB($ost_cv_thread_library, nanosleep,
		...

	The problem is that the resulting ./configure file checks
the variable $ost_cv_thread_library_nanosleep" instead of
${$ost_cv_thread_library)_nanosleep.  The following patch
seems to work around the problem.

	I think ths may arguably be an autoconf-2.50 bug, so
I am cc'ing this to autoconf@gnu.org for their information.

	Even if this is an autoconf bug, I believe that applying the
following patch to CommonC++ should be harmless, so I recommend that
you do it anyhow, to work with the existing autoconf-2.50 release in
any case.

-- 
Adam J. Richter     __     ______________   4880 Stevens Creek Blvd, Suite 104
adam@yggdrasil.com     \ /                  San Jose, California 95129-1034
+1 408 261-6630         | g g d r a s i l   United States of America
fax +1 408 261-6631      "Free Software For The Rest Of Us."

--u3/rZRmxL6MmkK24
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=CommonC++-diffs

diff -r -u CommonC++-1.5.0/m4/ost_pthread.m4 CommonC++/m4/ost_pthread.m4
--- CommonC++-1.5.0/m4/ost_pthread.m4	Sat Mar 31 07:15:47 2001
+++ CommonC++/m4/ost_pthread.m4	Thu Jun 28 17:56:40 2001
@@ -113,7 +113,7 @@
 		AC_MSG_ERROR(no library for posix threads found!)
 	fi
 
-	AC_CHECK_LIB($ost_cv_thread_library, nanosleep,
+	AC_CHECK_LIB(${ost_cv_thread_library}, nanosleep,
 		AC_DEFINE(HAVE_PTHREAD_NANOSLEEP),[
 		AC_CHECK_LIB(posix4, nanosleep,[
 			AC_DEFINE(HAVE_PTHREAD_NANOSLEEP)
@@ -185,54 +185,54 @@
 		;;
 	esac
 
-	AC_CHECK_LIB($ost_cv_thread_library, pthread_mutexattr_settype,
+	AC_CHECK_LIB(${ost_cv_thread_library}, pthread_mutexattr_settype,
 		AC_DEFINE(HAVE_PTHREAD_MUTEXATTR_SETTYPE),
 		[
-		AC_CHECK_LIB($ost_cv_thread_library, pthread_mutexattr_settype_np,
+		AC_CHECK_LIB(${ost_cv_thread_library}, pthread_mutexattr_settype_np,
 			AC_DEFINE(HAVE_PTHREAD_MUTEXATTR_SETTYPE_NP))
-		AC_CHECK_LIB($ost_cv_thread_library, pthread_mutexattr_setkind_np,
+		AC_CHECK_LIB(${ost_cv_thread_library}, pthread_mutexattr_setkind_np,
 			AC_DEFINE(HAVE_PTHREAD_MUTEXATTR_SETKIND_NP))
 		]
 	)
 
 	ost_cv_thread_rwlock=false
-	AC_CHECK_LIB($ost_cv_thread_library, pthread_rwlock_init,[
+	AC_CHECK_LIB(${ost_cv_thread_library}, pthread_rwlock_init,[
 		ost_cv_thread_rwlock=true
 		AC_DEFINE(HAVE_PTHREAD_RWLOCK)])
 
 	AC_CHECK_LIB(c, pread,[
 		AC_DEFINE(HAVE_PREAD_PWRITE)],[
-		AC_CHECK_LIB($ost_cv_thread_library, pread,[
+		AC_CHECK_LIB(${ost_cv_thread_library}, pread,[
 			AC_DEFINE(HAVE_PREAD_PWRITE)],[
 			AC_CHECK_LIB(c_r, pread,[AC_DEFINE(HAVE_PREAD_PWRITE)])
 		])
 	])
 
-	AC_CHECK_LIB($ost_cv_thread_library, pthread_attr_setstacksize,
+	AC_CHECK_LIB(${ost_cv_thread_library}, pthread_attr_setstacksize,
 		AC_DEFINE(HAVE_PTHREAD_ATTR_SETSTACKSIZE))
 
-	AC_CHECK_LIB($ost_cv_thread_library, pthread_yield,
+	AC_CHECK_LIB(${ost_cv_thread_library}, pthread_yield,
 		AC_DEFINE(HAVE_PTHREAD_YIELD),[
-		AC_CHECK_LIB($ost_cv_thread_library, sched_yield,
+		AC_CHECK_LIB(${ost_cv_thread_library}, sched_yield,
 			AC_DEFINE(HAVE_PTHREAD_SCHED_YIELD))
 		])
 
-	AC_CHECK_LIB($ost_cv_thread_library, pthread_cancel,[
+	AC_CHECK_LIB(${ost_cv_thread_library}, pthread_cancel,[
 		AC_DEFINE(HAVE_PTHREAD_CANCEL)
-	  	AC_CHECK_LIB($ost_cv_thread_library,
+	  	AC_CHECK_LIB(${ost_cv_thread_library},
 			pthread_setcanceltype,
 			AC_DEFINE(HAVE_PTHREAD_SETCANCELTYPE),
 			AC_CHECK_LIB($ost_cv_thread_library, pthread_setcanel,
 				AC_DEFINE(HAVE_PTHREAD_SETCANCEL)))
 		],[
-		AC_CHECK_LIB($ost_cv_thread_library,
+		AC_CHECK_LIB(${ost_cv_thread_library},
 			pthread_setcanceltype,[
 			AC_DEFINE(HAVE_PTHREAD_CANCEL)
 			AC_DEFINE(HAVE_PTHREAD_SETCANCELTYPE)])
 
 		])
 
-	AC_CHECK_LIB($ost_cv_thread_library, pthread_delay_np,
+	AC_CHECK_LIB(${ost_cv_thread_library}, pthread_delay_np,
 		AC_DEFINE(HAVE_PTHREAD_DELAY_NP))
   fi
   UNAME=`uname`
diff -r -u CommonC++-1.5.0/m4/ost_socket.m4 CommonC++/m4/ost_socket.m4
--- CommonC++-1.5.0/m4/ost_socket.m4	Sat Mar 31 07:16:10 2001
+++ CommonC++/m4/ost_socket.m4	Thu Jun 28 17:55:30 2001
@@ -42,7 +42,7 @@
 	if test $ost_cv_inet_sockets = yes ; then
 		AC_CHECK_HEADERS(sys/libcsys.h)
 		AC_DEFINE(HAVE_INET_SOCKETS)
-		AC_CHECK_LIB($ost_cv_lib_socket, inet_aton,[
+		AC_CHECK_LIB(${ost_cv_lib_socket}, inet_aton,[
 			AC_DEFINE(HAVE_INET_ATON)])
 		AC_CACHE_CHECK("for socklen_t defined", ost_cv_socklen_t, [ 
 			ost_cv_socklen_t='no'

--u3/rZRmxL6MmkK24--


From adam@yggdrasil.com Thu Jun 28 21:17:19 2001
Received: from ns1.yggdrasil.com ([209.249.10.20])
	by fencepost.gnu.org with esmtp (Exim 3.16 #1 (Debian))
	id 15FmuN-0001xX-00
	for <bug-commoncpp@gnu.org>; Thu, 28 Jun 2001 21:17:19 -0400
Received: from baldur.yggdrasil.com (baldur.yggdrasil.com [209.249.10.12])
	by ns1.yggdrasil.com (8.9.3/8.9.3) with ESMTP id SAA23857;
	Thu, 28 Jun 2001 18:17:18 -0700
Received: (from adam@localhost)
	by baldur.yggdrasil.com (8.9.3/8.9.3) id SAA00531;
	Thu, 28 Jun 2001 18:17:18 -0700
Date: Thu, 28 Jun 2001 18:17:18 -0700
From: "Adam J. Richter" <adam@yggdrasil.com>
To: bug-commoncpp@gnu.org
Subject: PATCH?: CommonC++-1.50/posix/{serial,fifo}.cpp may need iostream.h
Message-ID: <20010628181718.A524@baldur.yggdrasil.com>
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="ibTvN161/egqYuK8"
Content-Disposition: inline
User-Agent: Mutt/1.2i
Sender: bug-commoncpp-admin@gnu.org
Errors-To: bug-commoncpp-admin@gnu.org
X-BeenThere: bug-commoncpp@gnu.org
X-Mailman-Version: 2.0.5
Precedence: bulk
List-Help: <mailto:bug-commoncpp-request@gnu.org?subject=help>
List-Post: <mailto:bug-commoncpp@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=subscribe>
List-Id: Bug reports for Common C++ <bug-commoncpp.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=unsubscribe>
List-Archive: <http://mail.gnu.org/pipermail/bug-commoncpp/>

--ibTvN161/egqYuK8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

	I am not much of a C++ programmer, so I don't know if this patch
is correct.  What I do know is that CommonC++-1.50/posix/{fifo,serial}.cpp
did not compile under g++-3.0 on my system and that addding
"#include <iostream.h>" made them compile, and the rest of the library
build and installed successfully after that.  (Doing "#include <ios>",
which is what I tried first, did solve this problem.)

-- 
Adam J. Richter     __     ______________   4880 Stevens Creek Blvd, Suite 104
adam@yggdrasil.com     \ /                  San Jose, California 95129-1034
+1 408 261-6630         | g g d r a s i l   United States of America
fax +1 408 261-6631      "Free Software For The Rest Of Us."

--ibTvN161/egqYuK8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=diff2

--- CommonC++-1.5.0/posix/fifo.cpp	Tue Jun 26 12:21:11 2001
+++ CommonC++/posix/fifo.cpp	Thu Jun 28 18:02:44 2001
@@ -45,6 +45,7 @@
 #include <stdio.h>
 #include <fcntl.h>
 #include <sys/stat.h>
+#include <iostream.h>
 
 using std::fstream;
 
--- CommonC++-1.5.0/posix/serial.cpp	Wed Jun 27 04:02:30 2001
+++ CommonC++/posix/serial.cpp	Thu Jun 28 18:02:20 2001
@@ -46,6 +46,7 @@
 #include <limits.h>
 #include <termios.h>
 #include <errno.h>
+#include <iostream.h>
 
 using std::streambuf;
 using std::iostream;

--ibTvN161/egqYuK8--


From adam@yggdrasil.com Thu Jun 28 21:46:11 2001
Received: from ns1.yggdrasil.com ([209.249.10.20])
	by fencepost.gnu.org with esmtp (Exim 3.16 #1 (Debian))
	id 15FnMJ-0002ZY-00
	for <bug-commoncpp@gnu.org>; Thu, 28 Jun 2001 21:46:11 -0400
Received: from baldur.yggdrasil.com (baldur.yggdrasil.com [209.249.10.12])
	by ns1.yggdrasil.com (8.9.3/8.9.3) with ESMTP id SAA24133;
	Thu, 28 Jun 2001 18:46:10 -0700
From: "Adam J. Richter" <adam@yggdrasil.com>
Received: (from adam@localhost)
	by baldur.yggdrasil.com (8.9.3/8.9.3) id SAA22580;
	Thu, 28 Jun 2001 18:46:10 -0700
Date: Thu, 28 Jun 2001 18:46:10 -0700
Message-Id: <200106290146.SAA22580@baldur.yggdrasil.com>
To: bug-commoncpp@gnu.org
Subject: Should CommonC++-1.5.0/m4/ost_posix.m4 really be installed?
Sender: bug-commoncpp-admin@gnu.org
Errors-To: bug-commoncpp-admin@gnu.org
X-BeenThere: bug-commoncpp@gnu.org
X-Mailman-Version: 2.0.5
Precedence: bulk
List-Help: <mailto:bug-commoncpp-request@gnu.org?subject=help>
List-Post: <mailto:bug-commoncpp@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=subscribe>
List-Id: Bug reports for Common C++ <bug-commoncpp.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=unsubscribe>
List-Archive: <http://mail.gnu.org/pipermail/bug-commoncpp/>

	CommonC++-1.5.0 attemps to install CommonC++-1.50/m4/ost_check.m4
in /usr/share/aclocal/.  As a result, subsequents runs of aclocal on
the CommonC++ source tree abort because aclocal sees duplicate macros
in CommonC++-1.50/m4/ost_check.m4 and /usr/share/aclocal/.  Similarly,
ccscript sees the same type of conflict between its version of
ost_check.m4 and the one that CommonC++ put in /usr/share/aclocal/.
I have locally modified CommonC++-1.50/{m4,posix}/Makefile.am
to avoid this installation and can provide a patch to do so, although
I do not understand the situation well enough to know if this is the
right change.

Adam J. Richter     __     ______________   4880 Stevens Creek Blvd, Suite 104
adam@yggdrasil.com     \ /                  San Jose, California 95129-1034
+1 408 261-6630         | g g d r a s i l   United States of America
fax +1 408 261-6631      "Free Software For The Rest Of Us."


From adam@yggdrasil.com Thu Jun 28 21:57:19 2001
Received: from ns1.yggdrasil.com ([209.249.10.20])
	by fencepost.gnu.org with esmtp (Exim 3.16 #1 (Debian))
	id 15FnX5-0002nr-00
	for <bug-commoncpp@gnu.org>; Thu, 28 Jun 2001 21:57:19 -0400
Received: from baldur.yggdrasil.com (baldur.yggdrasil.com [209.249.10.12])
	by ns1.yggdrasil.com (8.9.3/8.9.3) with ESMTP id SAA24197;
	Thu, 28 Jun 2001 18:57:18 -0700
Received: (from adam@localhost)
	by baldur.yggdrasil.com (8.9.3/8.9.3) id SAA29780;
	Thu, 28 Jun 2001 18:57:18 -0700
Date: Thu, 28 Jun 2001 18:57:18 -0700
From: "Adam J. Richter" <adam@yggdrasil.com>
To: bug-commoncpp@gnu.org
Subject: PATCH: Typo in CommonC++-1.5.0/posix/ccgnu-config.in
Message-ID: <20010628185718.A25502@baldur.yggdrasil.com>
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="0F1p//8PRICkK4MW"
Content-Disposition: inline
User-Agent: Mutt/1.2i
Sender: bug-commoncpp-admin@gnu.org
Errors-To: bug-commoncpp-admin@gnu.org
X-BeenThere: bug-commoncpp@gnu.org
X-Mailman-Version: 2.0.5
Precedence: bulk
List-Help: <mailto:bug-commoncpp-request@gnu.org?subject=help>
List-Post: <mailto:bug-commoncpp@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=subscribe>
List-Id: Bug reports for Common C++ <bug-commoncpp.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=unsubscribe>
List-Archive: <http://mail.gnu.org/pipermail/bug-commoncpp/>

--0F1p//8PRICkK4MW
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

	The patch that I previously submitted for this was correct,
but someone apparently hand entered my patch for 1.5.0 and accidentally
made a typo.  This patch fixes the problem.

-- 
Adam J. Richter     __     ______________   4880 Stevens Creek Blvd, Suite 104
adam@yggdrasil.com     \ /                  San Jose, California 95129-1034
+1 408 261-6630         | g g d r a s i l   United States of America
fax +1 408 261-6631      "Free Software For The Rest Of Us."

--0F1p//8PRICkK4MW
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=diffs

--- CommonC++-1.5.0/posix/ccgnu-config.in	Tue Jun 26 03:40:05 2001
+++ CommonC++/posix/ccgnu-config.in	Thu Jun 28 18:52:57 2001
@@ -8,7 +8,7 @@
 exec_prefix="@exec_prefix@"
 libdir="-L@libdir@"
 
-if test "@includeddir@" = "/usr/include" ; then
+if test "@includedir@" = "/usr/include" ; then
 	includedir=""
 else
 	includedir="-I@includedir@"

--0F1p//8PRICkK4MW--


From akim@epita.fr Fri Jun 29 03:11:37 2001
Received: from hermes.epita.fr ([163.5.255.10])
	by fencepost.gnu.org with esmtp (Exim 3.16 #1 (Debian))
	id 15FsRF-0006Te-00; Fri, 29 Jun 2001 03:11:37 -0400
Received: from goa.lrde.epita.fr (mail@goa.lrde.epita.fr [10.223.13.2])
	by hermes.epita.fr id JAA06200
	Fri, 29 Jun 2001 09:09:46 GMT
Received: from nostromo.lrde.epita.fr ([10.223.13.52] ident=mail)
	by goa.lrde.epita.fr with esmtp (Exim 3.22 #1 (Debian))
	id 15FsXI-000209-00; Fri, 29 Jun 2001 09:17:52 +0200
Received: from akim by nostromo.lrde.epita.fr with local (Exim 3.22 #1 (Debian))
	id 15FsXH-0005ef-00; Fri, 29 Jun 2001 09:17:51 +0200
To: "Adam J. Richter" <adam@yggdrasil.com>
Cc: bug-commoncpp@gnu.org, autoconf@gnu.org
Subject: Re: PATCH: CommonC++-1.50/m4 vs. autoconf-2.50
References: <20010628181330.A502@baldur.yggdrasil.com>
From: Akim Demaille <akim@epita.fr>
Date: 29 Jun 2001 09:17:50 +0200
In-Reply-To: <20010628181330.A502@baldur.yggdrasil.com>
Message-ID: <mv4n16rzrdt.fsf@nostromo.lrde.epita.fr>
Lines: 2
User-Agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.4 (Academic Rigor)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Sender: bug-commoncpp-admin@gnu.org
Errors-To: bug-commoncpp-admin@gnu.org
X-BeenThere: bug-commoncpp@gnu.org
X-Mailman-Version: 2.0.5
Precedence: bulk
List-Help: <mailto:bug-commoncpp-request@gnu.org?subject=help>
List-Post: <mailto:bug-commoncpp@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=subscribe>
List-Id: Bug reports for Common C++ <bug-commoncpp.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=unsubscribe>
List-Archive: <http://mail.gnu.org/pipermail/bug-commoncpp/>

It is a bug in 2.50.  2.51 should be released within a couple of
weeks.


From beef@fudge.whatzit.org Fri Jun 29 07:20:31 2001
Received: from crucial.whatzit.org ([207.218.166.143])
	by fencepost.gnu.org with esmtp (Exim 3.16 #1 (Debian))
	id 15FwK6-00035O-00
	for <bug-commoncpp@gnu.org>; Fri, 29 Jun 2001 07:20:31 -0400
Received: (from smtp@localhost)
	by crucial.whatzit.org (8.9.3/8.9.3) id EAA01277
	for <bug-commoncpp@gnu.org>; Fri, 29 Jun 2001 04:19:55 -0700 (MST)
Received: from fudge.whatzit.org(207.218.166.40)
 via SMTP by crucial.whatzit.org, id smtpdAAAF0ayFc; Fri Jun 29 04:19:53 2001
Received: (from beef@localhost)
	by fudge.whatzit.org (8.9.3/8.9.3) id EAA14534
	for bug-commoncpp@gnu.org; Fri, 29 Jun 2001 04:20:29 -0700
Date: Fri, 29 Jun 2001 04:20:29 -0700
From: Brad Harvell <brad@whatzit.org>
To: bug-commoncpp@gnu.org
Subject: CommonC++-1.5.0 with gcc-3.0 bug (and fix)
Message-ID: <20010629042029.T21517@whatzit.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Mailer: Mutt 1.0i
Sender: bug-commoncpp-admin@gnu.org
Errors-To: bug-commoncpp-admin@gnu.org
X-BeenThere: bug-commoncpp@gnu.org
X-Mailman-Version: 2.0.5
Precedence: bulk
List-Help: <mailto:bug-commoncpp-request@gnu.org?subject=help>
List-Post: <mailto:bug-commoncpp@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=subscribe>
List-Id: Bug reports for Common C++ <bug-commoncpp.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=unsubscribe>
List-Archive: <http://mail.gnu.org/pipermail/bug-commoncpp/>

i have identified and found a fix for a bug in CommonC++-1.5.0
with gcc-3.0. 

grabbed CommonC++ from ftp://www.voxilla.org/pub/bayonne/

add #include <iostream.h> to posix/serial.cpp and posix/fifo.cpp.
gcc-3.0 doesn't seem to like ios::* without the include, tho
2.95.3 was satisfied as was.

after this fix, it compiles fine.


details:

# gcc -v
Reading specs from /usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.0/specs
Configured with: ./configure --enable-threads --enable-shared
Thread model: posix
gcc version 3.0

# ./configure;make
[.....]
c++ -DHAVE_CONFIG_H -I. -I. -I. -I../posix -g -O2 -D_GNU_SOURCE -D_REENTRANT -D_THREAD_SAFE -c  -fPIC -DPIC serial.cpp -o .libs/serial.lo
serial.cpp: In member function `virtual int TTYStream::uflow()':
serial.cpp:627: `ios' undeclared (first use this function)
serial.cpp:627: (Each undeclared identifier is reported only once for each 
   function it appears in.)
serial.cpp:627: parse error before `::' token
serial.cpp:638: confused by earlier errors, bailing out
make[1]: *** [serial.lo] Error 1
make[1]: Leaving directory `/usr/src/CommonC++-1.5.0/posix'
make: *** [all-recursive] Error 1
[...]
c++ -DHAVE_CONFIG_H -I. -I. -I. -I../posix -g -O2 -D_GNU_SOURCE -D_REENTRANT -D_THREAD_SAFE -c  -fPIC -DPIC fifo.cpp -o .libs/fifo.lo
fifo.cpp: In member function `void fifostream::open(const char*, long int)':
fifo.cpp:89: `ios' undeclared (first use this function)
fifo.cpp:89: (Each undeclared identifier is reported only once for each 
   function it appears in.)
fifo.cpp:89: parse error before `::' token
fifo.cpp: In constructor `cc_FIFOSession::cc_FIFOSession(const char*, long int, 
   cc_Semaphore*, int, int)':
fifo.cpp:113: parse error before `::' token
make[1]: *** [fifo.lo] Error 1
make[1]: Leaving directory `/usr/src/CommonC++-1.5.0/posix'
make: *** [all-recursive] Error 1


From dyfet@ostel.com Fri Jun 29 09:09:20 2001
Received: from [63.124.177.154] (helo=home.sys)
	by fencepost.gnu.org with smtp (Exim 3.16 #1 (Debian))
	id 15Fy1P-0007yz-00
	for <bug-commoncpp@gnu.org>; Fri, 29 Jun 2001 09:09:20 -0400
Received: from ostel.com (home.sys [172.16.1.254])
	by home.sys (Postfix) with ESMTP
	id 1B935A2F20; Fri, 29 Jun 2001 09:08:00 -0400 (EDT)
Message-ID: <3B3C7DB0.4090405@ostel.com>
Date: Fri, 29 Jun 2001 09:08:00 -0400
From: David Sugar <dyfet@ostel.com>
Organization: OST
User-Agent: Mozilla/5.0 (X11; U; Linux 2.2.16-9mdk i686; en-US; m18) Gecko/20001013
X-Accept-Language: en
MIME-Version: 1.0
To: Brad Harvell <brad@whatzit.org>
Cc: bug-commoncpp@gnu.org
Subject: Re: CommonC++-1.5.0 with gcc-3.0 bug (and fix)
References: <20010629042029.T21517@whatzit.org>
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
Sender: bug-commoncpp-admin@gnu.org
Errors-To: bug-commoncpp-admin@gnu.org
X-BeenThere: bug-commoncpp@gnu.org
X-Mailman-Version: 2.0.5
Precedence: bulk
List-Help: <mailto:bug-commoncpp-request@gnu.org?subject=help>
List-Post: <mailto:bug-commoncpp@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=subscribe>
List-Id: Bug reports for Common C++ <bug-commoncpp.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=unsubscribe>
List-Archive: <http://mail.gnu.org/pipermail/bug-commoncpp/>

Thats what 1.5.1 is for :)...I will get these and a few other things into cvs 
shortly.

Brad Harvell wrote:

> i have identified and found a fix for a bug in CommonC++-1.5.0
> with gcc-3.0. 
> 
> grabbed CommonC++ from ftp://www.voxilla.org/pub/bayonne/
> 
> add #include <iostream.h> to posix/serial.cpp and posix/fifo.cpp.
> gcc-3.0 doesn't seem to like ios::* without the include, tho
> 2.95.3 was satisfied as was.
> 
> after this fix, it compiles fine.
> 
> 
> details:
> 
> # gcc -v
> Reading specs from /usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.0/specs
> Configured with: ./configure --enable-threads --enable-shared
> Thread model: posix
> gcc version 3.0
> 
> # ./configure;make
> [.....]
> c++ -DHAVE_CONFIG_H -I. -I. -I. -I../posix -g -O2 -D_GNU_SOURCE -D_REENTRANT -D_THREAD_SAFE -c  -fPIC -DPIC serial.cpp -o .libs/serial.lo
> serial.cpp: In member function `virtual int TTYStream::uflow()':
> serial.cpp:627: `ios' undeclared (first use this function)
> serial.cpp:627: (Each undeclared identifier is reported only once for each 
>    function it appears in.)
> serial.cpp:627: parse error before `::' token
> serial.cpp:638: confused by earlier errors, bailing out
> make[1]: *** [serial.lo] Error 1
> make[1]: Leaving directory `/usr/src/CommonC++-1.5.0/posix'
> make: *** [all-recursive] Error 1
> [...]
> c++ -DHAVE_CONFIG_H -I. -I. -I. -I../posix -g -O2 -D_GNU_SOURCE -D_REENTRANT -D_THREAD_SAFE -c  -fPIC -DPIC fifo.cpp -o .libs/fifo.lo
> fifo.cpp: In member function `void fifostream::open(const char*, long int)':
> fifo.cpp:89: `ios' undeclared (first use this function)
> fifo.cpp:89: (Each undeclared identifier is reported only once for each 
>    function it appears in.)
> fifo.cpp:89: parse error before `::' token
> fifo.cpp: In constructor `cc_FIFOSession::cc_FIFOSession(const char*, long int, 
>    cc_Semaphore*, int, int)':
> fifo.cpp:113: parse error before `::' token
> make[1]: *** [fifo.lo] Error 1
> make[1]: Leaving directory `/usr/src/CommonC++-1.5.0/posix'
> make: *** [all-recursive] Error 1
> 
> _______________________________________________
> Bug-commoncpp mailing list
> Bug-commoncpp@gnu.org
> http://mail.gnu.org/mailman/listinfo/bug-commoncpp



