diff options
author | Wan-Teh Chang <wtc@google.com> | 2023-11-30 14:27:06 -0800 |
---|---|---|
committer | Jerome Jiang <jianj@google.com> | 2023-12-06 18:57:20 -0500 |
commit | c3b821fd4a76d2ad3d1582ed9fa1221375b5c242 (patch) | |
tree | a3413f38cc926c5ef04e24df3f2e8af022111546 | |
parent | ebca0ab6fa7862d3e511bf579446c5bc6f70bf4f (diff) | |
download | libvpx-c3b821fd4a76d2ad3d1582ed9fa1221375b5c242.tar.gz |
Add the needed Android API level predicates.
fseeko and ftello are available on Android only from API level 24. Add
the needed guards for these functions.
Suggested by Yifan Yang.
Change-Id: I3a6721d31e1d961ab10b434ea6e92959bd5a70ab
(cherry picked from commit bf0755418357237f6ea4794dfab3c474d06a0937)
-rw-r--r-- | tools_common.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/tools_common.h b/tools_common.h index 9850907c1..e2942d04b 100644 --- a/tools_common.h +++ b/tools_common.h @@ -32,7 +32,12 @@ typedef int64_t FileOffset; #define fseeko fseeko64 #define ftello ftello64 typedef off64_t FileOffset; -#elif CONFIG_OS_SUPPORT +#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 |