From e9560cec98b3a148cf255297ece4a24da765f03f Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Wed, 29 Nov 2017 17:04:00 +0100 Subject: [PATCH] fix sqlite3 compilation for ndk>=14 --- submodules/externals/sqlite3/sqlite3.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/submodules/externals/sqlite3/sqlite3.c b/submodules/externals/sqlite3/sqlite3.c index 320d6355e..2c0a5af74 100644 --- a/submodules/externals/sqlite3/sqlite3.c +++ b/submodules/externals/sqlite3/sqlite3.c @@ -30269,6 +30269,21 @@ SQLITE_PRIVATE const char *sqlite3OpcodeName(int i){ #include #if !defined(SQLITE_OMIT_WAL) || SQLITE_MAX_MMAP_SIZE>0 # include + +#if defined(__ANDROID__) + +/*this block is to workaround a bug introduced by google with its unified headers in NDK 14.*/ + +#include "android/api-level.h" + +# ifdef __ANDROID_API_O__ /*present with unified headers introduced with NDK14*/ +# if __ANDROID_API__ < 21 + /*mmap declaration is missing below api 21 in unified headers, but not in normal headers*/ + extern void* mmap(void*, size_t, int, int, int, off_t); +# endif +# endif +#endif /*defined(ANDROID)*/ + #endif #if SQLITE_ENABLE_LOCKING_STYLE