]> Savannah Git Hosting - gnulib.git/commitdiff
stdioext: port to newer 32-bit Android
authorPaul Eggert <eggert@cs.ucla.edu>
Sun, 23 Dec 2018 02:00:10 +0000 (18:00 -0800)
committerBruno Haible <bruno@clisp.org>
Sat, 5 Jan 2019 11:32:46 +0000 (12:32 +0100)
Problem reported by Tom Yan in:
https://lists.gnu.org/archive/html/bug-gnulib/2018-07/msg00014.html
* lib/stdio-impl.h (_gl_FILE_flags_t) [__ANDROID__]: New macro.
(fp_) [__ANDROID__]: Use it.

ChangeLog
lib/stdio-impl.h

index a64b7b721ab19bce1221b46cf65c8977a01447e2..bb3598a414baa9246a63d8b7cc113d10f47b2919 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2018-12-22  Paul Eggert  <eggert@cs.ucla.edu>
+
+       stdioext: port to newer 32-bit Android
+       Problem reported by Tom Yan in:
+       https://lists.gnu.org/archive/html/bug-gnulib/2018-07/msg00014.html
+       * lib/stdio-impl.h (_gl_FILE_flags_t) [__ANDROID__]: New macro.
+       (fp_) [__ANDROID__]: Use it.
+
 2019-01-04  Bruno Haible  <bruno@clisp.org>
 
        lock: Fix link error with --enable-threads=pth.
index b2b2971f2ffd37ffc3c7b8d8342804452620f279..4260468b612e80bb0452efc3c337f8a7edd81a5b 100644 (file)
 #  define _r pub._r
 #  define _w pub._w
 # elif defined __ANDROID__ /* Android */
+#  ifdef __LP64__
+#   define _gl_flags_file_t int
+#  else
+#   define _gl_flags_file_t short
+#  endif
   /* Up to this commit from 2015-10-12
      <https://android.googlesource.com/platform/bionic.git/+/f0141dfab10a4b332769d52fa76631a64741297a>
      the innards of FILE were public, and fp_ub could be defined like for OpenBSD,
@@ -70,8 +75,8 @@
 #  define fp_ ((struct { unsigned char *_p; \
                          int _r; \
                          int _w; \
-                         int _flags; \
-                         int _file; \
+                         _gl_flags_file_t _flags; \
+                         _gl_flags_file_t _file; \
                          struct { unsigned char *_base; size_t _size; } _bf; \
                          int _lbfsize; \
                          void *_cookie; \