common/tools_common.h: port f{seek,tell}o fix from libvpx

https://chromium-review.googlesource.com/c/webm/libvpx/+/5074786
bf0755418 Add the needed Android API level predicates.

Bug: aomedia:3561
Change-Id: Ie5c4b3134f3842cd55e5b07e22dffa4ba2584ea8
diff --git a/common/tools_common.h b/common/tools_common.h
index b31371c..9d891d1 100644
--- a/common/tools_common.h
+++ b/common/tools_common.h
@@ -37,8 +37,13 @@
 #define fseeko fseeko64
 #define ftello ftello64
 typedef off64_t FileOffset;
-#elif CONFIG_OS_SUPPORT
-#include <sys/types.h> /* NOLINT*/
+#elif CONFIG_OS_SUPPORT &&                                                  \
+    !(defined(__ANDROID__) && __ANDROID_API__ < 24 && !defined(__LP64__) && \
+      defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS == 64)
+/* POSIX.1 has fseeko and ftello. fseeko and ftello are not available before
+ * Android API level 24. See
+ * https://android.googlesource.com/platform/bionic/+/main/docs/32-bit-abi.md */
+#include <sys/types.h> /* NOLINT */
 typedef off_t FileOffset;
 /* Use 32-bit file operations in WebM file format when building ARM
  * executables (.axf) with RVCT. */