--- sparky/c++/memalloc.h.orig Mon Dec 23 13:10:42 2002 +++ sparky/c++/memalloc.h Mon Dec 23 13:11:41 2002 @@ -19,11 +19,16 @@ #include // use size_t +#if __GNUC__ >= 3 +#include +using namespace std; +#else void *operator new(size_t size); void operator delete(void *p); void *operator new[](size_t size); void operator delete[](void *p); +#endif // ---------------------------------------------------------------------------- // The lines below are for tracking all memory allocated with new. --- sparky/c++/nmrdata.h.orig Mon Dec 23 13:12:05 2002 +++ sparky/c++/nmrdata.h Mon Dec 23 13:16:51 2002 @@ -9,7 +9,12 @@ #include "spoint.h" // Use SPoint, IPoint, IRegion #include "stringc.h" // Use Stringy +#if __GNUC__ >= 3 +#include +using namespace std; +#else class ostream; +#endif class Block_File; --- sparky/c++/format.h.orig Mon Dec 23 13:13:57 2002 +++ sparky/c++/format.h Mon Dec 23 13:13:15 2002 @@ -4,8 +4,13 @@ #ifndef FORMAT_HEADER_INCLUDED #define FORMAT_HEADER_INCLUDED +#if __GNUC__ >= 3 +#include +using namespace std; +#else class istream; class ostream; +#endif class Condition; class Object_Table; --- sparky/c++/stringc.h.orig Mon Dec 23 13:14:32 2002 +++ sparky/c++/stringc.h Mon Dec 23 13:14:54 2002 @@ -8,8 +8,14 @@ #undef NULL // Fix bad define in stddef.h gnu distribution. #define NULL 0L +#if __GNUC__ >= 3 +#include +using namespace std; +#else class istream; class ostream; +#endif + class List; class Stringy --- sparky/c++/savefile.h.orig Mon Dec 23 13:19:28 2002 +++ sparky/c++/savefile.h Mon Dec 23 13:19:32 2002 @@ -9,7 +9,13 @@ #include "list.h" // Use List #include "stringc.h" // Use Stringy +#if __GNUC__ >= 3 +#include +using namespace std; +#else class ostream; +#endif + class Session; enum SAVEFILE_TYPE { --- sparky/c++/memalloc.cc.orig Mon Dec 23 13:20:53 2002 +++ sparky/c++/memalloc.cc Mon Dec 23 13:24:58 2002 @@ -11,8 +11,10 @@ #include "table.h" // use Table #include "utility.h" // use fatal_error() +#if __GNUC__ < 3 #undef new #undef delete +#endif // ---------------------------------------------------------------------------- // @@ -40,6 +42,9 @@ // ---------------------------------------------------------------------------- // void *operator new(size_t size) +#if __GNUC__ >= 3 + throw(std::bad_alloc) +#endif { void *value = allocate(size); if (tracking_memory) @@ -73,6 +78,9 @@ // ---------------------------------------------------------------------------- // void *operator new[](size_t size) +#if __GNUC__ >= 3 + throw(std::bad_alloc) +#endif { void *value = allocate(size); if (tracking_memory) @@ -92,6 +100,9 @@ // ---------------------------------------------------------------------------- // void operator delete(void *p) +#if __GNUC__ >= 3 + throw() +#endif { if (tracking_memory) forget(p); @@ -101,6 +112,9 @@ // ---------------------------------------------------------------------------- // void operator delete[](void *p) +#if __GNUC__ >= 3 + throw() +#endif { if (tracking_memory) forget(p);