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:
seawood%netscape.com
2002-07-02 20:25:30 +00:00
parent 2e8b6b11c8
commit a7c7e77b8b
87 changed files with 186 additions and 218 deletions

View File

@@ -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);
}

View File

@@ -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.