From 968997db5f4262f7cc6ce49ec889c8f9bfa78f4c Mon Sep 17 00:00:00 2001 From: Tyler Dauwalder Date: Tue, 27 May 2003 08:25:15 +0000 Subject: [PATCH] new(nothrow) is desired by SLList. My definition of nothrow is a bit sketchy here, but will work for now until I figure out the proper way to do it. git-svn-id: file:///srv/svn/repos/haiku/trunk/current@3359 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/add-ons/kernel/file_systems/udf/cpp.h | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/add-ons/kernel/file_systems/udf/cpp.h b/src/add-ons/kernel/file_systems/udf/cpp.h index f0e8aaa709..efba021d4d 100644 --- a/src/add-ons/kernel/file_systems/udf/cpp.h +++ b/src/add-ons/kernel/file_systems/udf/cpp.h @@ -10,6 +10,14 @@ #include #include +// I'm not entirely sure if this is such a great idea or not, but +// I can't find the standard definition of nothrow anywhere (in +// order to copy it properly here for kernel use), so this will +// do for the moment so things compile and I can go to bed. :-) +// ToDo: declare and define this thing properly +#ifndef nothrow +# define nothrow 0 +#endif // Oh no! C++ in the kernel! Are you nuts? // @@ -29,6 +37,13 @@ operator new(size_t size) } +inline void * +operator new(size_t size, const nothrow_t&) throw() +{ + return malloc(size); +} + + inline void * operator new[](size_t size) { @@ -36,6 +51,13 @@ operator new[](size_t size) } +inline void * +operator new[](size_t size, const nothrow_t&) throw() +{ + return malloc(size); +} + + inline void operator delete(void *ptr) {