From c52519cfcd3c75d581521082002825cefd75ab03 Mon Sep 17 00:00:00 2001 From: Tyler Dauwalder Date: Fri, 12 Sep 2003 06:38:49 +0000 Subject: [PATCH] Switched from local cpp.h/cpp.cpp to global kernel_cpp.h/kernel_cpp.cpp git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4642 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- .../udf/AllocationDescriptorList.h | 2 +- src/add-ons/kernel/file_systems/udf/Array.h | 2 +- .../kernel/file_systems/udf/CS0String.h | 2 +- .../kernel/file_systems/udf/CachedBlock.h | 2 +- .../file_systems/udf/DirectoryIterator.h | 2 +- .../kernel/file_systems/udf/DiskStructures.h | 2 +- src/add-ons/kernel/file_systems/udf/Icb.h | 2 +- src/add-ons/kernel/file_systems/udf/Jamfile | 10 ++- .../kernel/file_systems/udf/MemoryChunk.h | 2 +- .../kernel/file_systems/udf/PartitionMap.h | 2 +- .../kernel/file_systems/udf/UdfDebug.h | 2 +- src/add-ons/kernel/file_systems/udf/Volume.h | 2 +- src/add-ons/kernel/file_systems/udf/cpp.cpp | 17 ---- src/add-ons/kernel/file_systems/udf/cpp.h | 85 ------------------- src/add-ons/kernel/file_systems/udf/udf.cpp | 2 +- .../kernel/file_systems/udf/udf_shell/Jamfile | 4 +- 16 files changed, 22 insertions(+), 118 deletions(-) delete mode 100644 src/add-ons/kernel/file_systems/udf/cpp.cpp delete mode 100644 src/add-ons/kernel/file_systems/udf/cpp.h diff --git a/src/add-ons/kernel/file_systems/udf/AllocationDescriptorList.h b/src/add-ons/kernel/file_systems/udf/AllocationDescriptorList.h index 184a4718ab..f8941171f9 100644 --- a/src/add-ons/kernel/file_systems/udf/AllocationDescriptorList.h +++ b/src/add-ons/kernel/file_systems/udf/AllocationDescriptorList.h @@ -10,7 +10,7 @@ /*! \file AllocationDescriptorList.h */ -#include "cpp.h" +#include "kernel_cpp.h" #include "UdfDebug.h" #include "DiskStructures.h" diff --git a/src/add-ons/kernel/file_systems/udf/Array.h b/src/add-ons/kernel/file_systems/udf/Array.h index 0133668c02..62f05b35c5 100644 --- a/src/add-ons/kernel/file_systems/udf/Array.h +++ b/src/add-ons/kernel/file_systems/udf/Array.h @@ -10,7 +10,7 @@ #include -#include "cpp.h" +#include "kernel_cpp.h" #include "SupportDefs.h" diff --git a/src/add-ons/kernel/file_systems/udf/CS0String.h b/src/add-ons/kernel/file_systems/udf/CS0String.h index bef2a990bf..8ed82c7055 100644 --- a/src/add-ons/kernel/file_systems/udf/CS0String.h +++ b/src/add-ons/kernel/file_systems/udf/CS0String.h @@ -10,7 +10,7 @@ #include -#include "cpp.h" +#include "kernel_cpp.h" #include "Array.h" #include "UdfDebug.h" diff --git a/src/add-ons/kernel/file_systems/udf/CachedBlock.h b/src/add-ons/kernel/file_systems/udf/CachedBlock.h index aedc24ea86..59e56d38eb 100644 --- a/src/add-ons/kernel/file_systems/udf/CachedBlock.h +++ b/src/add-ons/kernel/file_systems/udf/CachedBlock.h @@ -25,7 +25,7 @@ extern "C" { #include "cache.h" } -#include "cpp.h" +#include "kernel_cpp.h" #include "UdfDebug.h" #include "DiskStructures.h" diff --git a/src/add-ons/kernel/file_systems/udf/DirectoryIterator.h b/src/add-ons/kernel/file_systems/udf/DirectoryIterator.h index 9ff61c0bc1..cae93fa436 100644 --- a/src/add-ons/kernel/file_systems/udf/DirectoryIterator.h +++ b/src/add-ons/kernel/file_systems/udf/DirectoryIterator.h @@ -18,7 +18,7 @@ extern "C" { #include } -#include "cpp.h" +#include "kernel_cpp.h" #include "UdfDebug.h" namespace Udf { diff --git a/src/add-ons/kernel/file_systems/udf/DiskStructures.h b/src/add-ons/kernel/file_systems/udf/DiskStructures.h index e0e1b6560a..1f9c13beb6 100644 --- a/src/add-ons/kernel/file_systems/udf/DiskStructures.h +++ b/src/add-ons/kernel/file_systems/udf/DiskStructures.h @@ -12,7 +12,7 @@ #include #include -#include "cpp.h" +#include "kernel_cpp.h" #include "UdfDebug.h" #include "Array.h" diff --git a/src/add-ons/kernel/file_systems/udf/Icb.h b/src/add-ons/kernel/file_systems/udf/Icb.h index 21de4da2c0..e05670deb6 100644 --- a/src/add-ons/kernel/file_systems/udf/Icb.h +++ b/src/add-ons/kernel/file_systems/udf/Icb.h @@ -18,7 +18,7 @@ extern "C" { #include } -#include "cpp.h" +#include "kernel_cpp.h" #include "UdfDebug.h" #include "CachedBlock.h" diff --git a/src/add-ons/kernel/file_systems/udf/Jamfile b/src/add-ons/kernel/file_systems/udf/Jamfile index d3d50670ee..2ddd20dd61 100644 --- a/src/add-ons/kernel/file_systems/udf/Jamfile +++ b/src/add-ons/kernel/file_systems/udf/Jamfile @@ -23,10 +23,11 @@ oldOPTIM = $(OPTIM) ; SubDirC++Flags $(defines) -Wall -Wno-multichar ; } -UsePrivateHeaders [ FDirName kernel util ] ; +UsePrivateHeaders [ FDirName kernel ] ; # For kernel_cpp.cpp +UsePrivateHeaders [ FDirName kernel util ] ; # For all the UDF source files R5KernelAddon udf : [ FDirName kernel file_systems udf ] : - cpp.cpp + kernel_cpp.cpp udf.cpp CS0String.cpp @@ -39,6 +40,11 @@ R5KernelAddon udf : [ FDirName kernel file_systems udf ] : Volume.cpp ; +SEARCH on [ FGristFiles + kernel_cpp.cpp + ] = [ FDirName $(OBOS_TOP) src kernel core util ] ; + + rule InstallUDF { Depends $(<) : $(>) ; diff --git a/src/add-ons/kernel/file_systems/udf/MemoryChunk.h b/src/add-ons/kernel/file_systems/udf/MemoryChunk.h index 3e33949209..f05467867a 100644 --- a/src/add-ons/kernel/file_systems/udf/MemoryChunk.h +++ b/src/add-ons/kernel/file_systems/udf/MemoryChunk.h @@ -10,7 +10,7 @@ #include -#include "cpp.h" +#include "kernel_cpp.h" namespace Udf { diff --git a/src/add-ons/kernel/file_systems/udf/PartitionMap.h b/src/add-ons/kernel/file_systems/udf/PartitionMap.h index 856c6ce7c4..d882bc173e 100644 --- a/src/add-ons/kernel/file_systems/udf/PartitionMap.h +++ b/src/add-ons/kernel/file_systems/udf/PartitionMap.h @@ -10,7 +10,7 @@ /*! \file PartitionMap.h */ -#include "cpp.h" +#include "kernel_cpp.h" #include "UdfDebug.h" #include "DiskStructures.h" diff --git a/src/add-ons/kernel/file_systems/udf/UdfDebug.h b/src/add-ons/kernel/file_systems/udf/UdfDebug.h index 5b5cc9b008..c9e48472b7 100644 --- a/src/add-ons/kernel/file_systems/udf/UdfDebug.h +++ b/src/add-ons/kernel/file_systems/udf/UdfDebug.h @@ -40,7 +40,7 @@ # endif #endif -#include "cpp.h" +#include "kernel_cpp.h" class DebugHelper; diff --git a/src/add-ons/kernel/file_systems/udf/Volume.h b/src/add-ons/kernel/file_systems/udf/Volume.h index 5834e4421c..365e7f3476 100644 --- a/src/add-ons/kernel/file_systems/udf/Volume.h +++ b/src/add-ons/kernel/file_systems/udf/Volume.h @@ -21,7 +21,7 @@ extern "C" { #include } -#include "cpp.h" +#include "kernel_cpp.h" #include "UdfDebug.h" #include "CS0String.h" diff --git a/src/add-ons/kernel/file_systems/udf/cpp.cpp b/src/add-ons/kernel/file_systems/udf/cpp.cpp deleted file mode 100644 index ffbbc129c0..0000000000 --- a/src/add-ons/kernel/file_systems/udf/cpp.cpp +++ /dev/null @@ -1,17 +0,0 @@ -/* cpp - C++ in the kernel -** -** Initial version by Axel Dörfler, axeld@pinc-software.de -** This file may be used under the terms of the OpenBeOS License. -*/ - - -#include "cpp.h" - - -extern "C" void -__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 deleted file mode 100644 index b10a11ea8e..0000000000 --- a/src/add-ons/kernel/file_systems/udf/cpp.h +++ /dev/null @@ -1,85 +0,0 @@ -#ifndef CPP_H -#define CPP_H -/* cpp - C++ in the kernel -** -** Initial version by Axel Dörfler, axeld@pinc-software.de -** This file may be used under the terms of the OpenBeOS License. -*/ - - -#include -#include - -#ifdef USER -#else -/*! 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? -// -// - no exceptions -// - (almost) no virtuals (well, the Query code now uses them) -// - it's basically only the C++ syntax, and type checking -// - since one tend to encapsulate everything in classes, it has a slightly -// higher memory overhead -// - nicer code -// - easier to maintain - - -inline void * -operator new(size_t size) -{ - return malloc(size); -} - - -inline void * -operator new(size_t size, const nothrow_t&) -{ - return malloc(size); -} - - -inline void * -operator new[](size_t size) -{ - return malloc(size); -} - - -inline void * -operator new[](size_t size, const nothrow_t&) -{ - return malloc(size); -} - - -inline void -operator delete(void *ptr) -{ - free(ptr); -} - - -inline void -operator delete[](void *ptr) -{ - free(ptr); -} - -// we're using virtuals -extern "C" void __pure_virtual(); - -#endif // USER - -#endif /* CPP_H */ diff --git a/src/add-ons/kernel/file_systems/udf/udf.cpp b/src/add-ons/kernel/file_systems/udf/udf.cpp index d65ac815e2..011dbcdcce 100644 --- a/src/add-ons/kernel/file_systems/udf/udf.cpp +++ b/src/add-ons/kernel/file_systems/udf/udf.cpp @@ -12,7 +12,7 @@ */ #include "UdfDebug.h" -#include "cpp.h" +#include "kernel_cpp.h" #include #include diff --git a/src/tests/add-ons/kernel/file_systems/udf/udf_shell/Jamfile b/src/tests/add-ons/kernel/file_systems/udf/udf_shell/Jamfile index c32d879d75..1174bc6476 100644 --- a/src/tests/add-ons/kernel/file_systems/udf/udf_shell/Jamfile +++ b/src/tests/add-ons/kernel/file_systems/udf/udf_shell/Jamfile @@ -16,7 +16,7 @@ SimpleTest udf_shell fsh.c rootfs.c initfs.c kernel.c cache.c sl.c stub.c sysdep.c hexdump.c argv.c - cpp.cpp udf.cpp + udf.cpp CS0String.cpp DirectoryIterator.cpp DiskStructures.cpp Icb.cpp PartitionMap.cpp UdfDebug.cpp Utils.cpp Volume.cpp : @@ -24,7 +24,7 @@ SimpleTest udf_shell # Tell Jam where to find these sources SEARCH on [ FGristFiles - cpp.cpp udf.cpp + udf.cpp CS0String.cpp DirectoryIterator.cpp DiskStructures.cpp Icb.cpp PartitionMap.cpp UdfDebug.cpp Utils.cpp Volume.cpp ] = [ FDirName $(OBOS_TOP) src add-ons kernel file_systems udf ] ;