mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2025-10-20 05:25:04 +08:00
[C++] Add cplusplus component
This commit is contained in:
27
components/cplusplus/crt.cpp
Normal file
27
components/cplusplus/crt.cpp
Normal 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");
|
||||
}
|
Reference in New Issue
Block a user