[BASESRV]
[reactos.git] / include / c++ / new
index afa35b9..821410e 100644 (file)
@@ -1,49 +1,47 @@
-// Standard C++ dynamic memory management header
-
-#ifndef _NEW
-#define _NEW
-
-#include <cstddef>
-#include <exception>
-
-extern "C++" {
-
-namespace std 
-{
-  class bad_alloc : public exception 
-  {
-  public:
-    bad_alloc() throw() { }
-
-    // This declaration is not useless:
-    // http://gcc.gnu.org/onlinedocs/gcc-3.0.2/gcc_6.html#SEC118
-    virtual ~bad_alloc() throw();
-
-    // See comment in eh_exception.cc.
-    virtual const char* what() const throw();
-  };
-
-  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\r
+\r
+#ifndef _NEW\r
+#define _NEW\r
+\r
+#include <cstddef>\r
+#include <exception>\r
+\r
+extern "C++" {\r
+\r
+class bad_alloc : public exception\r
+{\r
+public:\r
+    bad_alloc(const char *name = "bad alloc") throw()\r
+        : exception(name) { }\r
+\r
+    virtual ~bad_alloc() throw() { }\r
+};\r
+\r
+namespace std\r
+{\r
+    using ::bad_alloc;\r
+\r
+    struct nothrow_t { };\r
+\r
+    extern const nothrow_t nothrow;\r
+} // namespace std\r
+\r
+typedef void (*new_handler)();\r
+\r
+new_handler set_new_handler(new_handler) throw();\r
+\r
+void* operator new (std::size_t size, const std::nothrow_t& nothrow_constant) throw();\r
+inline void* operator new (std::size_t size, void* ptr) throw() { return ptr; }\r
+void* operator new[] (std::size_t size, const std::nothrow_t& nothrow_constant) throw();\r
+inline void* operator new[] (std::size_t size, void* ptr) throw() { return ptr; }\r
+\r
+void operator delete (void* ptr) throw ();\r
+void operator delete (void* ptr, const std::nothrow_t& nothrow_constant) throw();\r
+inline void operator delete (void* ptr, void* voidptr2) throw() { }\r
+void operator delete[] (void* ptr) throw ();\r
+void operator delete[] (void* ptr, const std::nothrow_t& nothrow_constant) throw();\r
+inline void operator delete[] (void* ptr, void* voidptr2) throw() { }\r
+\r
+} // extern "C++"\r
+\r
+#endif\r