bore wrote:
What is causing this is
int  _flags; \
int  _file; \
on 32bit it needs to be
short _flags; \
short _file; \

Thanks for the suggestion. Does the attached Gnulib patch fix the problem? I haven't installed it and can't easily test it.
>From 8f87a66104c1e270d3ada0eb2753ba835f7aa498 Mon Sep 17 00:00:00 2001
From: Paul Eggert <egg...@cs.ucla.edu>
Date: Sat, 22 Dec 2018 18:00:10 -0800
Subject: [PATCH] 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.
---
 ChangeLog        | 8 ++++++++
 lib/stdio-impl.h | 9 +++++++--
 2 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index d1f0d630e..3caba1491 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2018-12-22  Paul Eggert  <egg...@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.
+
 2018-12-21  Bruno Haible  <br...@clisp.org>
 
 	Assume Autoconf >= 2.63.
diff --git a/lib/stdio-impl.h b/lib/stdio-impl.h
index 393ef0cf5..e198f09ed 100644
--- a/lib/stdio-impl.h
+++ b/lib/stdio-impl.h
@@ -61,6 +61,11 @@
 #  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; \
-- 
2.17.1

Reply via email to