For gcc >= 2.95, add empty throw() function to remove warnings about returning null from operator new

git-svn-id: svn://10.0.0.236/trunk@47665 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
cls%seawood.org
1999-09-15 22:00:12 +00:00
parent a14ff84454
commit 043415ee86
2 changed files with 13 additions and 1 deletions

View File

@@ -131,7 +131,7 @@ public: \
#if (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95))
#define NS_DEF_PTR2(cls) \
private: \
void* operator new(size_t size) {} \
void* operator new(size_t size) throw () { return 0; } \
void operator delete(void* aPtr) {} \
cls* mPtr;
#else

View File

@@ -109,7 +109,11 @@ private:
// Not meant to be implemented. This makes it a compiler error to
// attempt to create an nsAutoLock object on the heap.
#if (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95))
static void* operator new(size_t /*size*/) throw () {
#else
static void* operator new(size_t /*size*/) {
#endif
return nsnull;
}
static void operator delete(void* /*memory*/) {}
@@ -197,7 +201,11 @@ private:
// Not meant to be implemented. This makes it a compiler error to
// attempt to create an nsAutoLock object on the heap.
#if (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95))
static void* operator new(size_t /*size*/) throw () {
#else
static void* operator new(size_t /*size*/) {
#endif
return nsnull;
}
static void operator delete(void* /*memory*/) {}
@@ -257,7 +265,11 @@ private:
// Not meant to be implemented. This makes it a compiler error to
// attempt to create an nsAutoLock object on the heap.
#if (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95))
static void* operator new(size_t /*size*/) throw() {
#else
static void* operator new(size_t /*size*/) {
#endif
return nsnull;
}
static void operator delete(void* /*memory*/) {}