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:
@@ -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
|
||||
|
||||
@@ -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*/) {}
|
||||
|
||||
Reference in New Issue
Block a user