diff --git a/src/unix/linux.c b/src/unix/linux.c index 110964884..be9f8348f 100644 --- a/src/unix/linux.c +++ b/src/unix/linux.c @@ -27,6 +27,7 @@ #include "internal.h" #include +#include #include #include /* offsetof */ #include @@ -56,6 +57,14 @@ #include #include +// android ndk workaround +#ifndef LLONG_MAX +#define LLONG_MAX 9223372036854775807LL +#endif +#ifndef LLONG_MIN +#define LLONG_MIN (-9223372036854775807LL - 1) +#endif + #ifndef __NR_io_uring_setup # define __NR_io_uring_setup 425 #endif diff --git a/test/runner.c b/test/runner.c index 87e7db0b0..5cfd8095c 100644 --- a/test/runner.c +++ b/test/runner.c @@ -28,7 +28,9 @@ #include "uv.h" /* Refs: https://github.com/libuv/libuv/issues/4369 */ -#if defined(__ANDROID__) +/* Refs: https://github.com/libuv/libuv/issues/5092 */ +#if defined(__ANDROID__) && __ANDROID_API__ >= __ANDROID_API_Q__ +#define USE_FDSAN #include #endif @@ -149,7 +151,7 @@ void log_tap_result(int test_count, void enable_fdsan(void) { /* Refs: https://github.com/libuv/libuv/issues/4369 */ -#if defined(__ANDROID__) +#if defined(USE_FDSAN) android_fdsan_set_error_level(ANDROID_FDSAN_ERROR_LEVEL_WARN_ALWAYS); #endif }