fix compile issue on latest esp-idf v4 - release

This commit is contained in:
Sebastien
2020-04-13 11:41:50 -04:00
parent fda25bbd30
commit 6c0cf516c0
3 changed files with 11 additions and 1 deletions

View File

@@ -1,4 +1,10 @@
idf_component_register(SRC_DIRS .
idf_component_register(SRCS operator.cpp utf8.c
REQUIRES esp_common pthread
INCLUDE_DIRS .
)
#doing our own implementation of new operator for some pre-compiled binaries
target_link_libraries(${COMPONENT_LIB} INTERFACE "-u _ZdlPv")
target_link_libraries(${COMPONENT_LIB} INTERFACE "-u _Znwj")

View File

@@ -0,0 +1,3 @@
#include <stdlib.h> // for malloc and free
void* operator new(unsigned int size) { return malloc(size); }
void operator delete(void* ptr) { if (ptr) free(ptr); }