mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-30 00:01:50 +00:00
For gcc >= 2.95, add empty throw() function to remove warnings about returning null from operator new
This commit is contained in:
parent
c00a954c6f
commit
1699d31f60
@ -131,7 +131,7 @@ public: \
|
|||||||
#if (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95))
|
#if (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95))
|
||||||
#define NS_DEF_PTR2(cls) \
|
#define NS_DEF_PTR2(cls) \
|
||||||
private: \
|
private: \
|
||||||
void* operator new(size_t size) {} \
|
void* operator new(size_t size) throw () { return 0; } \
|
||||||
void operator delete(void* aPtr) {} \
|
void operator delete(void* aPtr) {} \
|
||||||
cls* mPtr;
|
cls* mPtr;
|
||||||
#else
|
#else
|
||||||
|
@ -109,7 +109,11 @@ private:
|
|||||||
|
|
||||||
// Not meant to be implemented. This makes it a compiler error to
|
// Not meant to be implemented. This makes it a compiler error to
|
||||||
// attempt to create an nsAutoLock object on the heap.
|
// 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*/) {
|
static void* operator new(size_t /*size*/) {
|
||||||
|
#endif
|
||||||
return nsnull;
|
return nsnull;
|
||||||
}
|
}
|
||||||
static void operator delete(void* /*memory*/) {}
|
static void operator delete(void* /*memory*/) {}
|
||||||
@ -197,7 +201,11 @@ private:
|
|||||||
|
|
||||||
// Not meant to be implemented. This makes it a compiler error to
|
// Not meant to be implemented. This makes it a compiler error to
|
||||||
// attempt to create an nsAutoLock object on the heap.
|
// 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*/) {
|
static void* operator new(size_t /*size*/) {
|
||||||
|
#endif
|
||||||
return nsnull;
|
return nsnull;
|
||||||
}
|
}
|
||||||
static void operator delete(void* /*memory*/) {}
|
static void operator delete(void* /*memory*/) {}
|
||||||
@ -257,7 +265,11 @@ private:
|
|||||||
|
|
||||||
// Not meant to be implemented. This makes it a compiler error to
|
// Not meant to be implemented. This makes it a compiler error to
|
||||||
// attempt to create an nsAutoLock object on the heap.
|
// 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*/) {
|
static void* operator new(size_t /*size*/) {
|
||||||
|
#endif
|
||||||
return nsnull;
|
return nsnull;
|
||||||
}
|
}
|
||||||
static void operator delete(void* /*memory*/) {}
|
static void operator delete(void* /*memory*/) {}
|
||||||
|
Loading…
Reference in New Issue
Block a user