Skip to content

Commit

Permalink
Merge pull request #3163 from AaronChen0/jni
Browse files Browse the repository at this point in the history
fix implicit-function-declaration error when updating NDK to r26+
  • Loading branch information
Mygod authored Aug 21, 2024
2 parents 5a10078 + 2dade5e commit 3b1aa91
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion buildSrc/src/main/kotlin/Helpers.kt
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ fun Project.setupCore() {
warning += "RestrictedApi"
disable += "UseAppTint"
}
ndkVersion = "25.1.8937393"
ndkVersion = "27.0.12077973"
}
dependencies.add("coreLibraryDesugaring", "com.android.tools:desugar_jdk_libs:2.0.2")
}
Expand Down
5 changes: 4 additions & 1 deletion core/src/main/jni/Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,15 @@ include $(CLEAR_VARS)

LIBEVENT_SOURCES := \
buffer.c bufferevent.c event.c \
bufferevent_pair.c bufferevent_filter.c \
bufferevent_sock.c bufferevent_ratelim.c \
evthread.c log.c evutil.c evutil_rand.c evutil_time.c evmap.c epoll.c poll.c signal.c select.c

LOCAL_MODULE := event
LOCAL_SRC_FILES := $(addprefix libevent/, $(LIBEVENT_SOURCES))
LOCAL_CFLAGS := -I$(LOCAL_PATH)/libevent \
-I$(LOCAL_PATH)/libevent/include \
-Wno-error=implicit-function-declaration

include $(BUILD_STATIC_LIBRARY)

Expand Down Expand Up @@ -66,7 +68,7 @@ LOCAL_STATIC_LIBRARIES := libevent

LOCAL_MODULE := redsocks
LOCAL_SRC_FILES := $(addprefix redsocks/, $(REDSOCKS_SOURCES))
LOCAL_CFLAGS := -std=gnu99 -DUSE_IPTABLES \
LOCAL_CFLAGS := -std=gnu99 -DUSE_IPTABLES -D_GNU_SOURCE \
-I$(LOCAL_PATH)/redsocks \
-I$(LOCAL_PATH)/libevent/include \
-I$(LOCAL_PATH)/libevent
Expand All @@ -84,6 +86,7 @@ LOCAL_CFLAGS += -DBADVPN_THREADWORK_USE_PTHREAD -DBADVPN_LINUX -DBADVPN_BREACTOR
LOCAL_CFLAGS += -DBADVPN_USE_SIGNALFD -DBADVPN_USE_EPOLL
LOCAL_CFLAGS += -DBADVPN_LITTLE_ENDIAN -DBADVPN_THREAD_SAFE
LOCAL_CFLAGS += -DNDEBUG -DANDROID
LOCAL_CFLAGS += -Wno-parentheses -Wno-unused-value
# LOCAL_CFLAGS += -DTUN2SOCKS_JNI

LOCAL_STATIC_LIBRARIES := libancillary
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/jni/libevent
Submodule libevent updated 156 files

0 comments on commit 3b1aa91

Please sign in to comment.