From: Mikko Rasa Date: Thu, 19 Nov 2015 16:49:52 +0000 (+0200) Subject: Hack to make 64-bit seeks work on Android X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=521964476dfb940e197970fa921e515f7dfa3eab;p=libs%2Fcore.git Hack to make 64-bit seeks work on Android --- 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));