diff --git a/curl/src/main/native/Android.mk b/curl/src/main/native/Android.mk index 9ac658b..1b211dc 100644 --- a/curl/src/main/native/Android.mk +++ b/curl/src/main/native/Android.mk @@ -5,6 +5,7 @@ include $(LOCAL_PATH)/curl/src/Makefile.inc LOCAL_MODULE := curl LOCAL_SRC_FILES := $(addprefix curl/src/,$(CURL_CFILES)) LOCAL_SRC_FILES += $(addprefix curl/src/,$(CURLX_CFILES)) +LOCAL_SRC_FILES += $(LOCAL_PATH)/tinynew.cpp LOCAL_C_INCLUDES := $(LOCAL_PATH)/curl/lib ifeq ($(TARGET_ARCH_ABI),armeabi-v7a) LOCAL_C_INCLUDES += $(LOCAL_PATH)/config32 diff --git a/curl/src/main/native/tinynew.cpp b/curl/src/main/native/tinynew.cpp new file mode 100644 index 0000000..676ef11 --- /dev/null +++ b/curl/src/main/native/tinynew.cpp @@ -0,0 +1,26 @@ +#include +#include + +extern "C++" { + +namespace std { +using ::size_t; +} + +} + +void* operator new(std::size_t size) { + return malloc(size); +} + +void* operator new[](std::size_t size) { + return malloc(size); +} + +void operator delete(void* ptr) { + free(ptr); +} + +void operator delete[](void* ptr) { + free(ptr); +}