Skip to content

Commit

Permalink
Add the needed Android API level predicates.
Browse files Browse the repository at this point in the history
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 bf07554)
  • Loading branch information
wantehchang authored and jeromejj committed Dec 6, 2023
1 parent ebca0ab commit c3b821f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion tools_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit c3b821f

Please sign in to comment.