Add CPP_THROW_NEW macro to the build system. This macro should be used when defining a local |operator new| function. It will be set to an empty throw function by default on all platforms except mac CW builds. This will allow us to not crash on systems that expect |operator new| to throw an exception by default and will suppress compiler warnings about how |operator new| should throw an exception instead of returning NULL.
Bug 149032 r=timeless sr=scc git-svn-id: svn://10.0.0.236/trunk@124526 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -122,7 +122,7 @@ class CToken {
|
||||
* @param aSize -
|
||||
* @param aArena - Allocate memory from this pool.
|
||||
*/
|
||||
static void * operator new (size_t aSize,nsFixedSizeAllocator& anArena)
|
||||
static void * operator new (size_t aSize,nsFixedSizeAllocator& anArena) CPP_THROW_NEW
|
||||
{
|
||||
return anArena.Alloc(aSize);
|
||||
}
|
||||
|
||||
@@ -90,7 +90,7 @@ class nsCParserNode : public nsIParserNode {
|
||||
/**
|
||||
* Hide operator new; clients should use Create() instead.
|
||||
*/
|
||||
static void* operator new(size_t) { return 0; }
|
||||
static void* operator new(size_t) CPP_THROW_NEW { return 0; }
|
||||
|
||||
/**
|
||||
* Hide operator delete; clients should use Destroy() instead.
|
||||
|
||||
Reference in New Issue
Block a user