diff --git a/headers/os/game/GameSound.h b/headers/os/game/GameSound.h index 5ca2514677..5add552493 100644 --- a/headers/os/game/GameSound.h +++ b/headers/os/game/GameSound.h @@ -31,6 +31,7 @@ // System Includes ------------------------------------------------------------- #include +#include // Project Includes ------------------------------------------------------------ @@ -75,14 +76,14 @@ public: virtual status_t GetAttributes(gs_attribute * outAttributes, size_t inAttributeCount); -// void * operator new(size_t size); -// void * operator new(size_t size, const nothrow_t &) throw(); -// void operator delete(void * ptr); -//#if !__MWERKS__ + void * operator new(size_t size); + void * operator new(size_t size, const nothrow_t &) throw(); + void operator delete(void * ptr); +#if !__MWERKS__ // there's a bug in MWCC under R4.1 and earlier -// void operator delete(void * ptr, -// const nothrow_t &) throw(); -//#endif + void operator delete(void * ptr, + const nothrow_t &) throw(); +#endif static status_t SetMemoryPoolSize(size_t in_poolSize); static status_t LockMemoryPool(bool in_lockInCore); diff --git a/src/kits/game/GameSound.cpp b/src/kits/game/GameSound.cpp index 7e6b93aaeb..daf7d0e563 100644 --- a/src/kits/game/GameSound.cpp +++ b/src/kits/game/GameSound.cpp @@ -201,19 +201,37 @@ BGameSound::Perform(int32 selector, return B_ERROR; } -/* + void * BGameSound::operator new(size_t size) { - return NULL; + return ::operator new(size); +} + + +void * +BGameSound::operator new(size_t size, const nothrow_t &nt) throw() +{ + return ::operator new(size, nt); } void BGameSound::operator delete(void *ptr) { + ::operator delete(ptr); } -*/ + + +#if !__MWERKS__ +// there's a bug in MWCC under R4.1 and earlier +void +BGameSound::operator delete(void *ptr, const nothrow_t &nt) throw() +{ + ::operator delete(ptr, nt); +} +#endif + status_t BGameSound::SetMemoryPoolSize(size_t in_poolSize)