Browse Source

fix compile issue on latest esp-idf v4 - release

Sebastien 4 năm trước cách đây
mục cha
commit
6c0cf516c0

+ 1 - 0
components/squeezelite/CMakeLists.txt

@@ -12,6 +12,7 @@ idf_component_register( SRC_DIRS . external a1s tas57xx
 						 			services 
 						 			raop   
 						 			display
+						 			tools
 						 EMBED_FILES vu.data
 )
 

+ 7 - 1
components/tools/CMakeLists.txt

@@ -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")
+
+  

+ 3 - 0
components/tools/operator.cpp

@@ -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); }