From e4edcddbc5e3b4a12d8ab683ddebd394f2be8658 Mon Sep 17 00:00:00 2001 From: Tyler Dauwalder Date: Wed, 28 May 2003 07:35:04 +0000 Subject: [PATCH] Fixed nothrow declaration and definition to what I think should be the proper values. git-svn-id: file:///srv/svn/repos/haiku/trunk/current@3368 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/add-ons/kernel/file_systems/udf/cpp.cpp | 1 + src/add-ons/kernel/file_systems/udf/cpp.h | 20 ++++++++++++-------- 2 files changed, 13 insertions(+), 8 deletions(-) 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? //