summaryrefslogtreecommitdiff
path: root/lib/fseeko.c
diff options
context:
space:
mode:
authorKevin Cernekee <cernekee@google.com>2015-02-11 15:22:49 -0800
committerPaul Eggert <eggert@cs.ucla.edu>2015-02-11 15:47:44 -0800
commit8e19825e65924c36535bf70e21c26d2cbc6076ac (patch)
tree8ea1b71d6f4a96264acae6e3d7af7814c86aafee /lib/fseeko.c
parent6e0e31c383c86e297bfbb8dae89515b0587a1b15 (diff)
downloadgnulib-8e19825e65924c36535bf70e21c26d2cbc6076ac.tar.gz
Fix FILE struct compatibility with Android API level >= 21
* lib/stdio-impl.h: Test explicitly for __ANDROID__ instead of __sferror. Recent versions of Bionic's stdio.h no longer define __sferror. * lib/fbufmode.c: Likewise. * lib/fflush.c: Likewise. * lib/fpurge.c: Likewise. * lib/freadable.c: Likewise. * lib/freadahead.c: Likewise. * lib/freading.c: Likewise. * lib/freadptr.c: Likewise. * lib/freadseek.c: Likewise. * lib/fseeko.c: Likewise. * lib/fseterr.c: Likewise. * lib/fwritable.c: Likewise. * lib/fwriting.c: Likewise.
Diffstat (limited to 'lib/fseeko.c')
-rw-r--r--lib/fseeko.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/fseeko.c b/lib/fseeko.c
index 46ee04bf70..db67e0277a 100644
--- a/lib/fseeko.c
+++ b/lib/fseeko.c
@@ -51,7 +51,8 @@ fseeko (FILE *fp, off_t offset, int whence)
if (fp->_IO_read_end == fp->_IO_read_ptr
&& fp->_IO_write_ptr == fp->_IO_write_base
&& fp->_IO_save_base == NULL)
-#elif defined __sferror || defined __DragonFly__ /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin */
+#elif defined __sferror || defined __DragonFly__ || defined __ANDROID__
+ /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Android */
# if defined __SL64 && defined __SCLE /* Cygwin */
if ((fp->_flags & __SL64) == 0)
{
@@ -115,7 +116,8 @@ fseeko (FILE *fp, off_t offset, int whence)
off_t pos = lseek (fileno (fp), offset, whence);
if (pos == -1)
{
-#if defined __sferror || defined __DragonFly__ /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin */
+#if defined __sferror || defined __DragonFly__ || defined __ANDROID__
+ /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Android */
fp_->_flags &= ~__SOFF;
#endif
return -1;
@@ -124,7 +126,8 @@ fseeko (FILE *fp, off_t offset, int whence)
#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
fp->_flags &= ~_IO_EOF_SEEN;
fp->_offset = pos;
-#elif defined __sferror || defined __DragonFly__ /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin */
+#elif defined __sferror || defined __DragonFly__ || defined __ANDROID__
+ /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Android */
# if defined __CYGWIN__
/* fp_->_offset is typed as an integer. */
fp_->_offset = pos;