diff --git a/src/common.h b/src/common.h index c3a4fe55..8c528540 100644 --- a/src/common.h +++ b/src/common.h @@ -43,12 +43,19 @@ #define DEBUG_NO_AUTO_GC 0 #define DEBUG_GC_STATS 0 -#if (defined(__ANDROID__) && __ANDROID_API__ <= 22) +#ifdef __ANDROID__ +#include + +#if __NDK_MAJOR__ <= 22 #define PK_ENABLE_OS 0 #else #define PK_ENABLE_OS 1 #endif +#else +#define PK_ENABLE_OS 1 +#endif + // This is the maximum number of arguments in a function declaration // including positional arguments, keyword-only arguments, and varargs #define PK_MAX_CO_VARNAMES 255