diff --git a/src/add-ons/kernel/file_systems/udf/cpp.cpp b/src/add-ons/kernel/file_systems/udf/cpp.cpp index 7278f4b57d..ffbbc129c0 100644 --- a/src/add-ons/kernel/file_systems/udf/cpp.cpp +++ b/src/add-ons/kernel/file_systems/udf/cpp.cpp @@ -14,3 +14,4 @@ __pure_virtual() //printf("pure virtual function call"); } +const nothrow_t nothrow = {}; diff --git a/src/add-ons/kernel/file_systems/udf/cpp.h b/src/add-ons/kernel/file_systems/udf/cpp.h index efba021d4d..9861263082 100644 --- a/src/add-ons/kernel/file_systems/udf/cpp.h +++ b/src/add-ons/kernel/file_systems/udf/cpp.h @@ -10,14 +10,18 @@ #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 +/*! Looking through the \c <new> header on my Linux distro + (can't seem to find it in the R5 headers...), it looks like + the type of \c nothrow_t is just: + + struct nothrow_t {}; + + Thus, here I'm just declaring an externed \c nothrow_t var called + \c nothrow, and defining it in cpp.cpp to be initialized to \c {}. + So far, this seems to work okay. +*/ +extern const nothrow_t nothrow; + // Oh no! C++ in the kernel! Are you nuts? //