From 581cfaf2c08321225a5914c0b802f90b523f4c9b Mon Sep 17 00:00:00 2001 From: Tyler Dauwalder Date: Tue, 6 Jan 2004 00:27:34 +0000 Subject: [PATCH] - Added declaration and definition of std::nothrow - Wrapped everything but #includes in #if _KERNEL_MODE to keep from redeclaring/definining operator new and nothrow in userland. git-svn-id: file:///srv/svn/repos/haiku/trunk/current@5921 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- headers/private/kernel/util/kernel_cpp.h | 4 +++- src/kernel/core/util/kernel_cpp.cpp | 4 ++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/headers/private/kernel/util/kernel_cpp.h b/headers/private/kernel/util/kernel_cpp.h index 633fbc342b..3085b84483 100644 --- a/headers/private/kernel/util/kernel_cpp.h +++ b/headers/private/kernel/util/kernel_cpp.h @@ -10,9 +10,10 @@ #include #include +#if _KERNEL_MODE using namespace std; - +extern const nothrow_t std::nothrow; // Oh no! C++ in the kernel! Are you nuts? // @@ -72,5 +73,6 @@ operator delete[](void *ptr) throw () // we're using virtuals extern "C" void __pure_virtual(); +#endif // #if _KERNEL_MODE #endif /* CPP_H */ diff --git a/src/kernel/core/util/kernel_cpp.cpp b/src/kernel/core/util/kernel_cpp.cpp index 100ec54841..856a43b629 100644 --- a/src/kernel/core/util/kernel_cpp.cpp +++ b/src/kernel/core/util/kernel_cpp.cpp @@ -4,9 +4,11 @@ ** This file may be used under the terms of the OpenBeOS License. */ +#if _KERNEL_MODE #include "util/kernel_cpp.h" +const nothrow_t std::nothrow = {}; #if __GNUC__ == 2 @@ -24,3 +26,5 @@ __cxa_pure_virtual() } #endif + +#endif // _#if KERNEL_MODE