From 1a692b57a190f970d2455e8fc193d168a84782a9 Mon Sep 17 00:00:00 2001
From: Bruno Haible <bruno@clisp.org>
Date: Sun, 15 Jan 2023 11:10:09 +0100
Subject: [PATCH] =?utf8?q?fpending:=20Fix=20compilation=20error=20with=20N?=
 =?utf8?q?DK=20=E2=89=A5=20r14b=20and=20Android=20API=20<=2023.?=
MIME-Version: 1.0
Content-Type: text/plain; charset=utf8
Content-Transfer-Encoding: 8bit

Report and patch by Po Lu <luangruo@yahoo.com>.

* lib/fpending.c (__fpending) [__ANDROID__]: Use the fp_ macro.
---
 ChangeLog      | 6 ++++++
 lib/fpending.c | 2 +-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index 5a93988fce..3e3eef76ca 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2023-01-15  Bruno Haible  <bruno@clisp.org>
+
+	fpending: Fix compilation error with NDK ≥ r14b and Android API < 23.
+	Report and patch by Po Lu <luangruo@yahoo.com>.
+	* lib/fpending.c (__fpending) [__ANDROID__]: Use the fp_ macro.
+
 2023-01-14  Paul Eggert  <eggert@cs.ucla.edu>
 
 	test-framework-sh: work around AIX 7.2 diff bugs
diff --git a/lib/fpending.c b/lib/fpending.c
index 6408cff464..86136b0435 100644
--- a/lib/fpending.c
+++ b/lib/fpending.c
@@ -41,7 +41,7 @@ __fpending (FILE *fp)
   return fp->_IO_write_ptr - fp->_IO_write_base;
 #elif defined __sferror || defined __DragonFly__ || defined __ANDROID__
   /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin < 1.7.34, Minix 3, Android */
-  return fp->_p - fp->_bf._base;
+  return fp_->_p - fp_->_bf._base;
 #elif defined __EMX__                /* emx+gcc */
   return fp->_ptr - fp->_buffer;
 #elif defined __minix                /* Minix */
-- 
2.39.5