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
This commit is contained in:
Tyler Dauwalder
2003-09-12 06:38:49 +00:00
parent 184dd21b87
commit c52519cfcd
16 changed files with 22 additions and 118 deletions
@@ -10,7 +10,7 @@
/*! \file AllocationDescriptorList.h /*! \file AllocationDescriptorList.h
*/ */
#include "cpp.h" #include "kernel_cpp.h"
#include "UdfDebug.h" #include "UdfDebug.h"
#include "DiskStructures.h" #include "DiskStructures.h"
+1 -1
View File
@@ -10,7 +10,7 @@
#include <stdio.h> #include <stdio.h>
#include "cpp.h" #include "kernel_cpp.h"
#include "SupportDefs.h" #include "SupportDefs.h"
@@ -10,7 +10,7 @@
#include <stdio.h> #include <stdio.h>
#include "cpp.h" #include "kernel_cpp.h"
#include "Array.h" #include "Array.h"
#include "UdfDebug.h" #include "UdfDebug.h"
@@ -25,7 +25,7 @@ extern "C" {
#include "cache.h" #include "cache.h"
} }
#include "cpp.h" #include "kernel_cpp.h"
#include "UdfDebug.h" #include "UdfDebug.h"
#include "DiskStructures.h" #include "DiskStructures.h"
@@ -18,7 +18,7 @@ extern "C" {
#include <fsproto.h> #include <fsproto.h>
} }
#include "cpp.h" #include "kernel_cpp.h"
#include "UdfDebug.h" #include "UdfDebug.h"
namespace Udf { namespace Udf {
@@ -12,7 +12,7 @@
#include <ByteOrder.h> #include <ByteOrder.h>
#include <SupportDefs.h> #include <SupportDefs.h>
#include "cpp.h" #include "kernel_cpp.h"
#include "UdfDebug.h" #include "UdfDebug.h"
#include "Array.h" #include "Array.h"
+1 -1
View File
@@ -18,7 +18,7 @@ extern "C" {
#include <fsproto.h> #include <fsproto.h>
} }
#include "cpp.h" #include "kernel_cpp.h"
#include "UdfDebug.h" #include "UdfDebug.h"
#include "CachedBlock.h" #include "CachedBlock.h"
+8 -2
View File
@@ -23,10 +23,11 @@ oldOPTIM = $(OPTIM) ;
SubDirC++Flags $(defines) -Wall -Wno-multichar ; 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 ] : R5KernelAddon udf : [ FDirName kernel file_systems udf ] :
cpp.cpp kernel_cpp.cpp
udf.cpp udf.cpp
CS0String.cpp CS0String.cpp
@@ -39,6 +40,11 @@ R5KernelAddon udf : [ FDirName kernel file_systems udf ] :
Volume.cpp Volume.cpp
; ;
SEARCH on [ FGristFiles
kernel_cpp.cpp
] = [ FDirName $(OBOS_TOP) src kernel core util ] ;
rule InstallUDF rule InstallUDF
{ {
Depends $(<) : $(>) ; Depends $(<) : $(>) ;
@@ -10,7 +10,7 @@
#include <malloc.h> #include <malloc.h>
#include "cpp.h" #include "kernel_cpp.h"
namespace Udf { namespace Udf {
@@ -10,7 +10,7 @@
/*! \file PartitionMap.h /*! \file PartitionMap.h
*/ */
#include "cpp.h" #include "kernel_cpp.h"
#include "UdfDebug.h" #include "UdfDebug.h"
#include "DiskStructures.h" #include "DiskStructures.h"
@@ -40,7 +40,7 @@
# endif # endif
#endif #endif
#include "cpp.h" #include "kernel_cpp.h"
class DebugHelper; class DebugHelper;
+1 -1
View File
@@ -21,7 +21,7 @@ extern "C" {
#include <fsproto.h> #include <fsproto.h>
} }
#include "cpp.h" #include "kernel_cpp.h"
#include "UdfDebug.h" #include "UdfDebug.h"
#include "CS0String.h" #include "CS0String.h"
@@ -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 = {};
-85
View File
@@ -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 <new>
#include <stdlib.h>
#ifdef USER
#else
/*! Looking through the \c &lt;new&gt; 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:
<code>struct nothrow_t {};</code>
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 */
+1 -1
View File
@@ -12,7 +12,7 @@
*/ */
#include "UdfDebug.h" #include "UdfDebug.h"
#include "cpp.h" #include "kernel_cpp.h"
#include <Drivers.h> #include <Drivers.h>
#include <ctype.h> #include <ctype.h>
@@ -16,7 +16,7 @@ SimpleTest udf_shell
fsh.c rootfs.c initfs.c kernel.c cache.c sl.c stub.c fsh.c rootfs.c initfs.c kernel.c cache.c sl.c stub.c
sysdep.c hexdump.c argv.c sysdep.c hexdump.c argv.c
cpp.cpp udf.cpp udf.cpp
CS0String.cpp DirectoryIterator.cpp DiskStructures.cpp Icb.cpp CS0String.cpp DirectoryIterator.cpp DiskStructures.cpp Icb.cpp
PartitionMap.cpp UdfDebug.cpp Utils.cpp Volume.cpp PartitionMap.cpp UdfDebug.cpp Utils.cpp Volume.cpp
: :
@@ -24,7 +24,7 @@ SimpleTest udf_shell
# Tell Jam where to find these sources # Tell Jam where to find these sources
SEARCH on [ FGristFiles SEARCH on [ FGristFiles
cpp.cpp udf.cpp udf.cpp
CS0String.cpp DirectoryIterator.cpp DiskStructures.cpp Icb.cpp CS0String.cpp DirectoryIterator.cpp DiskStructures.cpp Icb.cpp
PartitionMap.cpp UdfDebug.cpp Utils.cpp Volume.cpp PartitionMap.cpp UdfDebug.cpp Utils.cpp Volume.cpp
] = [ FDirName $(OBOS_TOP) src add-ons kernel file_systems udf ] ; ] = [ FDirName $(OBOS_TOP) src add-ons kernel file_systems udf ] ;