blueloveTH 2 years ago
parent
commit
5616c87a23
1 changed files with 8 additions and 1 deletions
  1. 8 1
      src/common.h

+ 8 - 1
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 <android/ndk-version.h>
+
+#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