Build: Improve C++ support
Can choose the C++ standard (C++98/11/14/17/2a) Can link with standard C++ library (libstdc++) Add support of C++ exceptions Add support of C++ RTTI Add C++ options to subsys/cpp/Kconfig Implements new and delete using k_malloc and k_free if CONFIG_HEAP_MEM_POOL_SIZE is defined Signed-off-by: Benoit Leforestier <benoit.leforestier@gmail.com>
This commit is contained in:
parent
25d5736e69
commit
26e0f9a9e1
7 changed files with 233 additions and 63 deletions
|
@ -4846,61 +4846,6 @@ extern void _arch_start_cpu(int cpu_num, k_thread_stack_t *stack, int sz,
|
|||
}
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_CPLUSPLUS) && defined(__cplusplus)
|
||||
/*
|
||||
* Define new and delete operators.
|
||||
* At this moment, the operators do nothing since objects are supposed
|
||||
* to be statically allocated.
|
||||
*/
|
||||
inline void operator delete(void *ptr)
|
||||
{
|
||||
(void)ptr;
|
||||
}
|
||||
|
||||
inline void operator delete[](void *ptr)
|
||||
{
|
||||
(void)ptr;
|
||||
}
|
||||
|
||||
inline void *operator new(size_t size)
|
||||
{
|
||||
(void)size;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
inline void *operator new[](size_t size)
|
||||
{
|
||||
(void)size;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* Placement versions of operator new and delete */
|
||||
inline void operator delete(void *ptr1, void *ptr2)
|
||||
{
|
||||
(void)ptr1;
|
||||
(void)ptr2;
|
||||
}
|
||||
|
||||
inline void operator delete[](void *ptr1, void *ptr2)
|
||||
{
|
||||
(void)ptr1;
|
||||
(void)ptr2;
|
||||
}
|
||||
|
||||
inline void *operator new(size_t size, void *ptr)
|
||||
{
|
||||
(void)size;
|
||||
return ptr;
|
||||
}
|
||||
|
||||
inline void *operator new[](size_t size, void *ptr)
|
||||
{
|
||||
(void)size;
|
||||
return ptr;
|
||||
}
|
||||
|
||||
#endif /* defined(CONFIG_CPLUSPLUS) && defined(__cplusplus) */
|
||||
|
||||
#include <tracing.h>
|
||||
#include <syscalls/kernel.h>
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue