From 521964476dfb940e197970fa921e515f7dfa3eab Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Thu, 19 Nov 2015 18:49:52 +0200 Subject: [PATCH] Hack to make 64-bit seeks work on Android --- source/io/unix/seekable.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/source/io/unix/seekable.cpp b/source/io/unix/seekable.cpp index 93a6e86..a402742 100644 --- a/source/io/unix/seekable.cpp +++ b/source/io/unix/seekable.cpp @@ -29,6 +29,13 @@ int sys_seek_type(SeekType st) namespace Msp { namespace IO { +/* Android libc does not recognize _FILE_OFFSET_BITS so this hack is necessary +to get 64-bit seeks. */ +#ifdef __ANDROID__ +#define off_t off64_t +#define lseek lseek64 +#endif + SeekOffset sys_seek(Handle &handle, SeekOffset offset, SeekType type) { off_t ret = lseek(*handle, offset, sys_seek_type(type)); -- 2.45.2