Thread: [Cppunit-devel] Small patch for cppunit on Alpha Tru64 Unix 5.1
Brought to you by:
blep
From: Petter R. <pe...@hu...> - 2001-06-09 00:25:22
|
Hello I had to apply the following patch to get cppunit 1.5.5 to compile using Compaq C++ on Tru64 Unix. Please include it in the next distribution. :-) diff -cr /store/store/palantir/cppunit/src-1.5.5/src/cppunit/TextTestResult.cpp src-1.5.5-alphadec5/src/cppunit/TextTestResult.cpp *** /store/store/palantir/cppunit/src-1.5.5/src/cppunit/TextTestResult.cpp Thu Jun 7 10:19:51 2001 --- src-1.5.5-alphadec5/src/cppunit/TextTestResult.cpp Sat Jun 9 02:15:28 2001 *************** *** 1,3 **** --- 1,7 ---- + // Needed on Tru64 Unix 5.1 to choose if pre-ANSI or ANSI iostreams should + // be used. + #define __USE_STD_IOSTREAM + #include <iostream> #include "cppunit/TextTestResult.h" #include "cppunit/Exception.h" *************** *** 7,13 **** namespace CppUnit { std::ostream& ! CppUnit::operator<< (std::ostream& stream, TextTestResult& result) { result.print (stream); return stream; } --- 11,17 ---- namespace CppUnit { std::ostream& ! operator<< (std::ostream& stream, TextTestResult& result) { result.print (stream); return stream; } diff -cr /store/store/palantir/cppunit/src-1.5.5/examples/hierarchy/main.cpp src-1.5.5-alphadec5/examples/hierarchy/main.cpp *** /store/store/palantir/cppunit/src-1.5.5/examples/hierarchy/main.cpp Thu Jun 7 10:19:49 2001 --- src-1.5.5-alphadec5/examples/hierarchy/main.cpp Sat Jun 9 02:16:23 2001 *************** *** 1,3 **** --- 1,5 ---- + #define __USE_STD_IOSTREAM + #include "cppunit/TestRegistry.h" #include "cppunit/TextTestResult.h" #include "cppunit/TestSuite.h" diff -cr /store/store/palantir/cppunit/src-1.5.5/include/cppunit/Exception.h src-1.5.5-alphadec5/include/cppunit/Exception.h *** /store/store/palantir/cppunit/src-1.5.5/include/cppunit/Exception.h Thu Jun 7 10:19:50 2001 --- src-1.5.5-alphadec5/include/cppunit/Exception.h Sat Jun 9 02:09:56 2001 *************** *** 12,18 **** * */ ! class Exception : public exception { public: Exception (std::string message = "", --- 12,18 ---- * */ ! class Exception : public std::exception { public: Exception (std::string message = "", *************** *** 20,26 **** std::string fileName = UNKNOWNFILENAME); Exception (const Exception& other); ! virtual ~Exception (); Exception& operator= (const Exception& other); --- 20,26 ---- std::string fileName = UNKNOWNFILENAME); Exception (const Exception& other); ! virtual ~Exception () throw(); Exception& operator= (const Exception& other); diff -cr /store/store/palantir/cppunit/src-1.5.5/src/cppunit/Exception.cpp src-1.5.5-alphadec5/src/cppunit/Exception.cpp *** /store/store/palantir/cppunit/src-1.5.5/src/cppunit/Exception.cpp Thu Jun 7 10:19:50 2001 --- src-1.5.5-alphadec5/src/cppunit/Exception.cpp Sat Jun 9 02:11:38 2001 *************** *** 23,29 **** /// Destruct the exception ! CppUnit::Exception::~Exception () {} --- 23,29 ---- /// Destruct the exception ! CppUnit::Exception::~Exception () throw () {} diff -cr /store/store/palantir/cppunit/src-1.5.5/src/cppunit/TestCase.cpp src-1.5.5-alphadec5/src/cppunit/TestCase.cpp *** /store/store/palantir/cppunit/src-1.5.5/src/cppunit/TestCase.cpp Thu Jun 7 10:19:51 2001 --- src-1.5.5-alphadec5/src/cppunit/TestCase.cpp Sat Jun 9 02:10:31 2001 *************** *** 31,37 **** result->addFailure (this, copy); } ! catch (exception& e) { result->addError (this, new Exception (e.what ())); } --- 31,37 ---- result->addFailure (this, copy); } ! catch (std::exception& e) { result->addError (this, new Exception (e.what ())); } |
From: Baptiste L. <bl...@cl...> - 2001-06-10 09:38:58
|
Is #define __USE_STD_IOSTREAM due to the use of RogueWave STL ? I think I already read something about it somewhere (either here or in the forum). If that is the case, it would be better to detect the use of those STL (it is a crossplatform library) in the configure script and have config.h do those define. Baptiste. ----- Original Message ----- From: "Petter Reinholdtsen" <pe...@hu...> To: <cpp...@li...> Sent: Saturday, June 09, 2001 2:25 AM Subject: [Cppunit-devel] Small patch for cppunit on Alpha Tru64 Unix 5.1 > > Hello > > I had to apply the following patch to get cppunit 1.5.5 to compile > using Compaq C++ on Tru64 Unix. Please include it in the next > distribution. :-) > --- Baptiste Lepilleur <gai...@fr...> http://gaiacrtn.free.fr/index.html Author of The Text Reformatter, a tool for fanfiction readers and writers. Language: English, French (Well, I'm French). |
From: Steve M. R. <ste...@vi...> - 2001-06-11 13:44:02
|
I'll endorse Baptiste's concern: it is extremely dangerous to add random #defines to the code --- especially ones with leading underscores! If the symbol is needed to enable a feature on some platforms, it can be detected for in the configure script. Petter: what feature is missing if __USE_STD_IOSTREAM is NOT defined? Does the problem appear in Tru64 4.x, by chance? I have a 4.0f system (on which I could work out a configure test), but no 5.x systems. -Steve On Sun, Jun 10, 2001 at 11:53:46AM +0200, Baptiste Lepilleur wrote: > Is #define __USE_STD_IOSTREAM due to the use of RogueWave STL ? I think I > already read something about it somewhere (either here or in the forum). > > If that is the case, it would be better to detect the use of those STL (it > is a crossplatform library) in the configure script and have config.h do > those define. > > Baptiste. > > ----- Original Message ----- > From: "Petter Reinholdtsen" <pe...@hu...> > To: <cpp...@li...> > Sent: Saturday, June 09, 2001 2:25 AM > Subject: [Cppunit-devel] Small patch for cppunit on Alpha Tru64 Unix 5.1 > > > > > > Hello > > > > I had to apply the following patch to get cppunit 1.5.5 to compile > > using Compaq C++ on Tru64 Unix. Please include it in the next > > distribution. :-) -- by Rocket to the Moon, by Airplane to the Rocket, by Taxi to the Airport, by Frontdoor to the Taxi, by throwing back the blanket and laying down the legs ... - They Might Be Giants |
From: Petter R. <pe...@hu...> - 2001-06-11 13:54:17
|
[Steve M. Robbins] > Petter: what feature is missing if __USE_STD_IOSTREAM is NOT defined? > Does the problem appear in Tru64 4.x, by chance? I have a 4.0f system > (on which I could work out a configure test), but no 5.x systems. The code refuses to compile if it isn't defined. Apparently, the C++ library on Tru64 5.x (I know nothing of Tru64 4.x) require one of two defines to allow iostreams to be included. I choose the Standard C++ define when compiling cppunit. A simple compile test in configure.in should solve the problem. |
From: Baptiste L. <gai...@fr...> - 2001-06-11 14:21:25
|
Quoting Petter Reinholdtsen <pe...@hu...>: > [Steve M. Robbins] > > Petter: what feature is missing if __USE_STD_IOSTREAM is NOT defined? > > Does the problem appear in Tru64 4.x, by chance? I have a 4.0f system > > (on which I could work out a configure test), but no 5.x systems. > > The code refuses to compile if it isn't defined. Apparently, the C++ > library on Tru64 5.x (I know nothing of Tru64 4.x) require one of two > defines to allow iostreams to be included. I choose the Standard C++ > define when compiling cppunit. > > A simple compile test in configure.in should solve the problem. > I searched RogueWave documentation for that symbol. Here is what I found (excerpt of Tools++ 7.1.1 toolread.doc): ---------------------------------------------------------- *************************** **** DEC C++ on OSF users **** *************************** Tools.h++ is certified for: Digital UNIX V4.0F for DEC C++ V6.1, with POSIX threads NOTE: Either DEC or RW Standard Library can be used 1. If you compile Tools.h++ with the DEC Standard Library, Tools.h++ will use the old-style iostreams rather than the new iostreams specified by the published C++ Standard. The reason for this is that DEC cxx uses the old iostreams by default and requires the user to put -D__USE_STD_IOSTREAM in the cxx command line in order to get the new iostreams. ---------------------------------------------------------- So it seems to be a platform specific "feature" ;-) Hope this help, Baptiste. --- Baptiste Lepilleur <gai...@fr...> http://gaiacrtn.free.fr/index.html Language: English, French |
From: Baptiste L. <bl...@cl...> - 2001-09-24 21:35:53
|
Resurecting an old thread in answer to [Is that really "RogueWave"?] ;-) => if you look carefuly, what RogueWave doc say (below) is that the problem is related to DEC cxx, not RogueWave, but to compile RogueWave STL, you must also define the flag. Baptiste. ----- Original Message ----- From: "Baptiste Lepilleur" <gai...@fr...> To: <cpp...@li...> Sent: Monday, June 11, 2001 4:21 PM Subject: Re: [Cppunit-devel] Small patch for cppunit on Alpha Tru64 Unix 5.1 > Quoting Petter Reinholdtsen <pe...@hu...>: > > > [Steve M. Robbins] > > > Petter: what feature is missing if __USE_STD_IOSTREAM is NOT defined? > > > Does the problem appear in Tru64 4.x, by chance? I have a 4.0f system > > > (on which I could work out a configure test), but no 5.x systems. > > > > The code refuses to compile if it isn't defined. Apparently, the C++ > > library on Tru64 5.x (I know nothing of Tru64 4.x) require one of two > > defines to allow iostreams to be included. I choose the Standard C++ > > define when compiling cppunit. > > > > A simple compile test in configure.in should solve the problem. > > > I searched RogueWave documentation for that symbol. Here is what I found > (excerpt of Tools++ 7.1.1 toolread.doc): > ---------------------------------------------------------- > *************************** > **** DEC C++ on OSF users **** > *************************** > > Tools.h++ is certified for: > Digital UNIX V4.0F for DEC C++ V6.1, with POSIX threads > NOTE: Either DEC or RW Standard Library can be used > > 1. If you compile Tools.h++ with the DEC Standard Library, Tools.h++ > will use the old-style iostreams rather than the new iostreams > specified by the published C++ Standard. The reason for this is that > DEC cxx uses the old iostreams by default and requires the user to > put -D__USE_STD_IOSTREAM in the cxx command line in order to get > the new iostreams. > ---------------------------------------------------------- > > So it seems to be a platform specific "feature" ;-) > > Hope this help, > Baptiste. --- Baptiste Lepilleur <ble...@fr...> http://gaiacrtn.free.fr/index.html Author of The Text Reformatter, a tool for fanfiction readers and writers. Language: English, French (Well, I'm French). |