diff options
Diffstat (limited to 'gnulib-tests/stdio-impl.h')
-rw-r--r-- | gnulib-tests/stdio-impl.h | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/gnulib-tests/stdio-impl.h b/gnulib-tests/stdio-impl.h index 393ef0c..067b95e 100644 --- a/gnulib-tests/stdio-impl.h +++ b/gnulib-tests/stdio-impl.h @@ -1,5 +1,5 @@ /* Implementation details of FILE streams. - Copyright (C) 2007-2008, 2010-2018 Free Software Foundation, Inc. + Copyright (C) 2007-2008, 2010-2020 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -18,11 +18,16 @@ the same implementation of stdio extension API, except that some fields have different naming conventions, or their access requires some casts. */ -/* Glibc 2.28 made _IO_IN_BACKUP private. For now, work around this - problem by defining it ourselves. FIXME: Do not rely on glibc +/* Glibc 2.28 made _IO_UNBUFFERED and _IO_IN_BACKUP private. For now, work + around this problem by defining them ourselves. FIXME: Do not rely on glibc internals. */ -#if !defined _IO_IN_BACKUP && defined _IO_EOF_SEEN -# define _IO_IN_BACKUP 0x100 +#if defined _IO_EOF_SEEN +# if !defined _IO_UNBUFFERED +# define _IO_UNBUFFERED 0x2 +# endif +# if !defined _IO_IN_BACKUP +# define _IO_IN_BACKUP 0x100 +# endif #endif /* BSD stdio derived implementations. */ @@ -61,6 +66,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 +80,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; \ |