Removed the "_dontthrow" stuff - "nothrow" is already defined anyway, and
now used instead. Some style cleanups. git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2829 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -8,9 +8,8 @@
|
|||||||
#include "cpp.h"
|
#include "cpp.h"
|
||||||
|
|
||||||
|
|
||||||
nothrow_t _dontthrow;
|
extern "C" void
|
||||||
|
__pure_virtual()
|
||||||
extern "C" void __pure_virtual()
|
|
||||||
{
|
{
|
||||||
//printf("pure virtual function call");
|
//printf("pure virtual function call");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,31 +22,38 @@
|
|||||||
// - easier to maintain
|
// - easier to maintain
|
||||||
|
|
||||||
|
|
||||||
inline void *operator new(size_t size, const nothrow_t&) throw()
|
inline void *
|
||||||
|
operator new(size_t size, const nothrow_t&) throw()
|
||||||
{
|
{
|
||||||
return malloc(size);
|
return malloc(size);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void *operator new[](size_t size, const nothrow_t&) throw()
|
|
||||||
|
inline void *
|
||||||
|
operator new[](size_t size, const nothrow_t&) throw()
|
||||||
{
|
{
|
||||||
return malloc(size);
|
return malloc(size);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void operator delete(void *ptr)
|
|
||||||
|
inline void
|
||||||
|
operator delete(void *ptr)
|
||||||
{
|
{
|
||||||
free(ptr);
|
free(ptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void operator delete[](void *ptr)
|
|
||||||
|
inline void
|
||||||
|
operator delete[](void *ptr)
|
||||||
{
|
{
|
||||||
free(ptr);
|
free(ptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
// now we're using virtuals
|
// we're using virtuals
|
||||||
extern "C" void __pure_virtual();
|
extern "C" void __pure_virtual();
|
||||||
|
|
||||||
extern nothrow_t _dontthrow;
|
// we are only using the nothrow-version of new
|
||||||
#define new new (_dontthrow)
|
#define new new (nothrow)
|
||||||
|
|
||||||
|
|
||||||
#endif /* CPP_H */
|
#endif /* CPP_H */
|
||||||
|
|||||||
Reference in New Issue
Block a user