[C++] Add cplusplus component

This commit is contained in:
Bernard Xiong
2014-11-01 09:09:21 +08:00
parent 0797e54f3f
commit b84123b0b4
4 changed files with 66 additions and 0 deletions

View File

@@ -0,0 +1,27 @@
#include <rtthread.h>
#include "crt.h"
void *operator new(size_t size)
{
return rt_malloc(size);
}
void *operator new[](size_t size)
{
return rt_malloc(size);
}
void operator delete(void *ptr)
{
rt_free(ptr);
}
void operator delete[] (void *ptr)
{
return rt_free(ptr);
}
void __cxa_pure_virtual(void)
{
rt_kprintf("Illegal to call a pure virtual function.\n");
}