X-Git-Url: https://git.reactos.org/?p=reactos.git;a=blobdiff_plain;f=sdk%2Finclude%2Fc%2B%2B%2Fnew;h=1f82a00a07b8e2a4a0b91e5cf2918e7a6d7ae9ee;hp=821410e31d4b37e0cadee8f7f4dd11a0174b15c1;hb=c34fa1e3899bf3f3a9f58c11ba78c919d40220b6;hpb=321bcc056d3a807b7c212f91663b592178f8b819 diff --git a/sdk/include/c++/new b/sdk/include/c++/new index 821410e31d4..1f82a00a07b 100644 --- a/sdk/include/c++/new +++ b/sdk/include/c++/new @@ -1,47 +1,47 @@ -// Standard C++ dynamic memory management header - -#ifndef _NEW -#define _NEW - -#include -#include - -extern "C++" { - -class bad_alloc : public exception -{ -public: - bad_alloc(const char *name = "bad alloc") throw() - : exception(name) { } - - virtual ~bad_alloc() throw() { } -}; - -namespace std -{ - using ::bad_alloc; - - struct nothrow_t { }; - - extern const nothrow_t nothrow; -} // namespace std - -typedef void (*new_handler)(); - -new_handler set_new_handler(new_handler) throw(); - -void* operator new (std::size_t size, const std::nothrow_t& nothrow_constant) throw(); -inline void* operator new (std::size_t size, void* ptr) throw() { return ptr; } -void* operator new[] (std::size_t size, const std::nothrow_t& nothrow_constant) throw(); -inline void* operator new[] (std::size_t size, void* ptr) throw() { return ptr; } - -void operator delete (void* ptr) throw (); -void operator delete (void* ptr, const std::nothrow_t& nothrow_constant) throw(); -inline void operator delete (void* ptr, void* voidptr2) throw() { } -void operator delete[] (void* ptr) throw (); -void operator delete[] (void* ptr, const std::nothrow_t& nothrow_constant) throw(); -inline void operator delete[] (void* ptr, void* voidptr2) throw() { } - -} // extern "C++" - -#endif +// Standard C++ dynamic memory management header + +#ifndef _NEW +#define _NEW + +#include +#include + +extern "C++" { + +class bad_alloc : public exception +{ +public: + bad_alloc(const char *name = "bad alloc") throw() + : exception(name) { } + + virtual ~bad_alloc() throw() { } +}; + +namespace std +{ + using ::bad_alloc; + + struct nothrow_t { }; + + extern const nothrow_t nothrow; +} // namespace std + +typedef void (*new_handler)(); + +new_handler set_new_handler(new_handler) throw(); + +void* operator new (std::size_t size, const std::nothrow_t& nothrow_constant) throw(); +inline void* operator new (std::size_t size, void* ptr) throw() { return ptr; } +void* operator new[] (std::size_t size, const std::nothrow_t& nothrow_constant) throw(); +inline void* operator new[] (std::size_t size, void* ptr) throw() { return ptr; } + +void operator delete (void* ptr) throw (); +void operator delete (void* ptr, const std::nothrow_t& nothrow_constant) throw(); +inline void operator delete (void* ptr, void* voidptr2) throw() { } +void operator delete[] (void* ptr) throw (); +void operator delete[] (void* ptr, const std::nothrow_t& nothrow_constant) throw(); +inline void operator delete[] (void* ptr, void* voidptr2) throw() { } + +} // extern "C++" + +#endif