Bruno Haible <br...@clisp.org> writes: > Before we make any change, we need to know what is wrong, i.e. what is > "the fpending bug on Android". You haven't said so, after I asked in > <https://lists.gnu.org/archive/html/bug-gnulib/2022-12/msg00087.html> > > Please be specific: What do you mean by "not works"? Does not compile? > Does not return which value?
Apologies for missing those details. It doesn't compile because ->_p and ->_base are undefined in FILE *. >> diff --git a/xcompile/lib/fpending.c b/xcompile/lib/fpending.c >> index afa840b8512..e57155e586e 100644 >> --- a/xcompile/lib/fpending.c >> +++ b/xcompile/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 */ > > IMO, this patch is a no-op: > > - If you are using an Android NDK older than r14b, the definition of > 'struct __sFILE' is directly in <stdio.h> and thus visible. > > - If you are using an Android NDK r14b or newer, with __ANDROID_API__ > being < 24, the definition of 'struct __sFILE' has been moved out > to <bits/struct_file.h> but is still included from <stdio.h> and is > thus visible. I'm using the NDK r25b; however, bits/struct_file.h in the NDK r25b only includes: __BEGIN_DECLS /** The opaque structure implementing `FILE`. Do not make any assumptions about its content. */ struct __sFILE { #if defined(__LP64__) char __private[152]; #else char __private[84]; #endif } __attribute__((aligned(sizeof(void*)))); __END_DECLS even when __ANDROID_API__ is 19. > So, in order to investigate this, you need to > - explain what you meant by "not works", > - run your configure script with option -C, > - report the results of > grep -i fpending config.cache > and > grep -i fpending config.status > - say which NDK version you're using, > - say what is the __ANDROID_API__ value in your environment. Thanks, I will do this later today.