Skip to content

Commit

Permalink
new BoringSSL need STL
Browse files Browse the repository at this point in the history
  • Loading branch information
vvb2060 committed Sep 12, 2024
1 parent af8742e commit 6bbd796
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
1 change: 1 addition & 0 deletions curl/src/main/native/Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
26 changes: 26 additions & 0 deletions curl/src/main/native/tinynew.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#include <malloc.h>
#include <stddef.h>

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

1 comment on commit 6bbd796

@vvb2060
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.