3rdparty/licenseReport: Add seperate LGPL checks
[haiku.git] / src / add-ons / kernel / file_systems / reiserfs / cpp.h
blob2e63c47b6d26b567d9c8acc8cb4fa741d5b99ad8
1 #ifndef CPP_H
2 #define CPP_H
3 /* cpp - C++ in the kernel
4 **
5 ** Initial version by Axel Dörfler, axeld@pinc-software.de
6 ** This file may be used under the terms of the MIT License.
7 */
9 #ifdef __cplusplus
11 #include <new>
12 #include <stdlib.h>
14 using namespace std;
16 // Oh no! C++ in the kernel! Are you nuts?
18 // - no exceptions
19 // - (almost) no virtuals (well, the Query code now uses them)
20 // - it's basically only the C++ syntax, and type checking
21 // - since one tend to encapsulate everything in classes, it has a slightly
22 // higher memory overhead
23 // - nicer code
24 // - easier to maintain
27 inline void *operator new(size_t size, const nothrow_t&) throw()
29 return malloc(size);
32 inline void *operator new[](size_t size, const nothrow_t&) throw()
34 return malloc(size);
37 inline void operator delete(void *ptr)
39 free(ptr);
42 inline void operator delete[](void *ptr)
44 free(ptr);
47 // now we're using virtuals
48 extern "C" void __pure_virtual();
50 //extern nothrow_t _dontthrow;
51 //#define new new (_dontthrow)
53 #endif // __cplusplus
55 #endif /* CPP_H */