From 90072e721dd2994e0846ae87bf11d290ea54304a Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Wed, 3 Nov 2004 17:33:17 +0000 Subject: [PATCH] Always define the symbols needed for basic C++ features. If we link against libgcc.a the symbols from there are simply overridden. git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9778 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- headers/private/kernel/util/kernel_cpp.h | 7 ------- src/kernel/core/util/kernel_cpp.cpp | 22 ++++++++++++---------- 2 files changed, 12 insertions(+), 17 deletions(-) diff --git a/headers/private/kernel/util/kernel_cpp.h b/headers/private/kernel/util/kernel_cpp.h index eabc002fc3..5a22f3cb72 100644 --- a/headers/private/kernel/util/kernel_cpp.h +++ b/headers/private/kernel/util/kernel_cpp.h @@ -71,13 +71,6 @@ operator delete[](void *ptr) throw () free(ptr); } -// only needed in the boot loader -#ifndef _BOOT_MODE - -extern "C" void __pure_virtual(); - -#endif // #if _BOOT_MODE - #endif // #if _KERNEL_MODE #endif // __cplusplus diff --git a/src/kernel/core/util/kernel_cpp.cpp b/src/kernel/core/util/kernel_cpp.cpp index 8d568c013a..6d42bac915 100644 --- a/src/kernel/core/util/kernel_cpp.cpp +++ b/src/kernel/core/util/kernel_cpp.cpp @@ -4,11 +4,17 @@ ** This file may be used under the terms of the OpenBeOS License. */ -// stripped down C++ support for the boot loader -#ifdef _BOOT_MODE - #include "util/kernel_cpp.h" +#ifdef _BOOT_MODE +# include +#elif defined(_KERNEL_MODE) +# include +#endif + +// Always define the symbols needed when not linking against libgcc.a -- +// we simply override them. + const nothrow_t std::nothrow = {}; #if __GNUC__ == 2 @@ -16,7 +22,7 @@ const nothrow_t std::nothrow = {}; extern "C" void __pure_virtual() { - //printf("pure virtual function call"); + panic("pure virtual function call\n"); } #elif __GNUC__ >= 3 @@ -24,20 +30,16 @@ __pure_virtual() extern "C" void __cxa_pure_virtual() { + panic("pure virtual function call\n"); } #endif - // full C++ support in the kernel -#elif _KERNEL_MODE // #endif _BOOT_MODE +#if defined(_KERNEL_MODE) && !defined(_BOOT_MODE) #include -#include - -#include "util/kernel_cpp.h" - FILE *stderr = NULL; extern "C"