android: fix termux build (#5093)
Fixes: https://github.com/libuv/libuv/issues/5092
This commit is contained in:
parent
8877568581
commit
e3a27e0728
@ -27,6 +27,7 @@
|
||||
#include "internal.h"
|
||||
|
||||
#include <inttypes.h>
|
||||
#include <limits.h>
|
||||
#include <stdatomic.h>
|
||||
#include <stddef.h> /* offsetof */
|
||||
#include <stdint.h>
|
||||
@ -56,6 +57,14 @@
|
||||
#include <time.h>
|
||||
#include <unistd.h>
|
||||
|
||||
/* 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
|
||||
|
||||
@ -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 <android/fdsan.h>
|
||||
#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
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user