bug-commoncpp
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: fixes for gcc 3.0


From: David Sugar
Subject: Re: fixes for gcc 3.0
Date: Fri, 22 Jun 2001 18:22:21 -0400
User-agent: Mozilla/5.0 (X11; U; Linux 2.2.16-9mdk i686; en-US; m18) Gecko/20001013

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" <address@hidden> writes:

"Felix Natter" <address@hidden> wrote in message
news:address@hidden

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






reply via email to

[Prev in Thread] Current Thread [Next in Thread]