diff options
| author | Paul Eggert | 2018-05-21 11:42:18 -0700 |
|---|---|---|
| committer | Paul Eggert | 2018-05-21 11:43:07 -0700 |
| commit | 79f15092b9d16631840cd42db034b787fae762ac (patch) | |
| tree | 86f3e4917944af36516547d4d19d5dda758684f1 /lib/stdio-impl.h | |
| parent | f21db9e1206f830ee5e991a26f9e30056f68efb8 (diff) | |
| download | emacs-79f15092b9d16631840cd42db034b787fae762ac.tar.gz emacs-79f15092b9d16631840cd42db034b787fae762ac.zip | |
Update from Gnulib
This incorporates:
2018-05-21 crypto: omit stream ops Emacs doesn’t need
2018-05-13 truncate: Fix compilation error on Android
2018-05-13 imaxdiv: Fix compilation error on Android
2018-05-13 Support selective inclusion of recent mingw.org headers
2018-05-13 Add cross-compilation guesses for Linux systems sans glibc
2018-05-13 stdioext: Fix compilation errors with newer Android headers
2018-05-07 af_alg: Pacify --enable-gcc-warnings
2018-05-06 af_alg: Fix bug with streams that are not at position 0
2018-05-06 Followup to 'af_alg: New module'
2018-05-05 crypto/{md5,sha1,sha256,sha512}: simplify
2018-05-05 af_alg: New module
2018-05-05 af_alg: Improve function signature
2018-04-28 md5sum: Use AF_ALG when available
2018-04-28 sha512sum: Use AF_ALG when available
2018-04-28 sha256sum: Use AF_ALG when available
2018-04-28 sha1sum: Use AF_ALG when available
2018-05-05 all: Replace more http URLs by https URLs
2018-05-03 maint: port more modules to GCC 8
2018-05-03 Simplify code; drop support for Borland C++ on Windows
* admin/merge-gnulib (GNULIB_MODULES): Use crypto/md5-buffer
rather than crypto/md5, since Emacs doesn’t use the stream
operations that in recent Gnulib pull in other stuff Emacs doesn’t
need. Similarly for crypto/sha1-buffer, crypto/sha256-buffer,
crypto/sha512-buffer.
* build-aux/config.guess, build-aux/config.sub, lib/dosname.h:
* lib/dup2.c, lib/errno.in.h, lib/euidaccess.c, lib/fcntl.c:
* lib/fcntl.in.h, lib/fpending.c, lib/fsync.c, lib/getdtablesize.c:
* lib/getopt.c, lib/gettimeofday.c, lib/inttypes.in.h, lib/md5.c:
* lib/md5.h, lib/open.c, lib/pipe2.c, lib/putenv.c, lib/sha1.c:
* lib/sha1.h, lib/sha256.c, lib/sha256.h, lib/sha512.c:
* lib/sha512.h, lib/stat-time.h, lib/stdio-impl.h, lib/stdio.in.h:
* lib/stdlib.in.h, lib/sys_stat.in.h, lib/sys_types.in.h:
* lib/timespec.h, lib/unistd.in.h, lib/utimens.c, m4/c-strtod.m4:
* m4/gnulib-common.m4, m4/inttypes.m4, m4/lstat.m4, m4/nocrash.m4:
* m4/pselect.m4, m4/readlink.m4, m4/stdio_h.m4, m4/symlink.m4:
* m4/unistd_h.m4, m4/utimens.m4:
Copy from Gnulib.
* lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate.
Diffstat (limited to 'lib/stdio-impl.h')
| -rw-r--r-- | lib/stdio-impl.h | 62 |
1 files changed, 58 insertions, 4 deletions
diff --git a/lib/stdio-impl.h b/lib/stdio-impl.h index 05c5752a243..393ef0cf58d 100644 --- a/lib/stdio-impl.h +++ b/lib/stdio-impl.h | |||
| @@ -60,25 +60,79 @@ | |||
| 60 | # define _flags pub._flags | 60 | # define _flags pub._flags |
| 61 | # define _r pub._r | 61 | # define _r pub._r |
| 62 | # define _w pub._w | 62 | # define _w pub._w |
| 63 | # elif defined __ANDROID__ /* Android */ | ||
| 64 | /* Up to this commit from 2015-10-12 | ||
| 65 | <https://android.googlesource.com/platform/bionic.git/+/f0141dfab10a4b332769d52fa76631a64741297a> | ||
| 66 | the innards of FILE were public, and fp_ub could be defined like for OpenBSD, | ||
| 67 | see <https://android.googlesource.com/platform/bionic.git/+/e78392637d5086384a5631ddfdfa8d7ec8326ee3/libc/stdio/fileext.h> | ||
| 68 | and <https://android.googlesource.com/platform/bionic.git/+/e78392637d5086384a5631ddfdfa8d7ec8326ee3/libc/stdio/local.h>. | ||
| 69 | After this commit, the innards of FILE are hidden. */ | ||
| 70 | # define fp_ ((struct { unsigned char *_p; \ | ||
| 71 | int _r; \ | ||
| 72 | int _w; \ | ||
| 73 | int _flags; \ | ||
| 74 | int _file; \ | ||
| 75 | struct { unsigned char *_base; size_t _size; } _bf; \ | ||
| 76 | int _lbfsize; \ | ||
| 77 | void *_cookie; \ | ||
| 78 | void *_close; \ | ||
| 79 | void *_read; \ | ||
| 80 | void *_seek; \ | ||
| 81 | void *_write; \ | ||
| 82 | struct { unsigned char *_base; size_t _size; } _ext; \ | ||
| 83 | unsigned char *_up; \ | ||
| 84 | int _ur; \ | ||
| 85 | unsigned char _ubuf[3]; \ | ||
| 86 | unsigned char _nbuf[1]; \ | ||
| 87 | struct { unsigned char *_base; size_t _size; } _lb; \ | ||
| 88 | int _blksize; \ | ||
| 89 | fpos_t _offset; \ | ||
| 90 | /* More fields, not relevant here. */ \ | ||
| 91 | } *) fp) | ||
| 63 | # else | 92 | # else |
| 64 | # define fp_ fp | 93 | # define fp_ fp |
| 65 | # endif | 94 | # endif |
| 66 | 95 | ||
| 67 | # if (defined __NetBSD__ && __NetBSD_Version__ >= 105270000) || defined __OpenBSD__ || defined __minix || defined __ANDROID__ /* NetBSD >= 1.5ZA, OpenBSD, Minix 3, Android */ | 96 | # if (defined __NetBSD__ && __NetBSD_Version__ >= 105270000) || defined __OpenBSD__ || defined __minix /* NetBSD >= 1.5ZA, OpenBSD, Minix 3 */ |
| 68 | /* See <http://cvsweb.netbsd.org/bsdweb.cgi/src/lib/libc/stdio/fileext.h?rev=HEAD&content-type=text/x-cvsweb-markup> | 97 | /* See <http://cvsweb.netbsd.org/bsdweb.cgi/src/lib/libc/stdio/fileext.h?rev=HEAD&content-type=text/x-cvsweb-markup> |
| 69 | and <https://cvsweb.openbsd.org/cgi-bin/cvsweb/src/lib/libc/stdio/fileext.h?rev=HEAD&content-type=text/x-cvsweb-markup> */ | 98 | and <https://cvsweb.openbsd.org/cgi-bin/cvsweb/src/lib/libc/stdio/fileext.h?rev=HEAD&content-type=text/x-cvsweb-markup> |
| 99 | and <https://github.com/Stichting-MINIX-Research-Foundation/minix/blob/master/lib/libc/stdio/fileext.h> */ | ||
| 70 | struct __sfileext | 100 | struct __sfileext |
| 71 | { | 101 | { |
| 72 | struct __sbuf _ub; /* ungetc buffer */ | 102 | struct __sbuf _ub; /* ungetc buffer */ |
| 73 | /* More fields, not relevant here. */ | 103 | /* More fields, not relevant here. */ |
| 74 | }; | 104 | }; |
| 75 | # define fp_ub ((struct __sfileext *) fp->_ext._base)->_ub | 105 | # define fp_ub ((struct __sfileext *) fp->_ext._base)->_ub |
| 76 | # else /* FreeBSD, NetBSD <= 1.5Z, DragonFly, Mac OS X, Cygwin, Android */ | 106 | # elif defined __ANDROID__ /* Android */ |
| 107 | struct __sfileext | ||
| 108 | { | ||
| 109 | struct { unsigned char *_base; size_t _size; } _ub; /* ungetc buffer */ | ||
| 110 | /* More fields, not relevant here. */ | ||
| 111 | }; | ||
| 112 | # define fp_ub ((struct __sfileext *) fp_->_ext._base)->_ub | ||
| 113 | # else /* FreeBSD, NetBSD <= 1.5Z, DragonFly, Mac OS X, Cygwin */ | ||
| 77 | # define fp_ub fp_->_ub | 114 | # define fp_ub fp_->_ub |
| 78 | # endif | 115 | # endif |
| 79 | 116 | ||
| 80 | # define HASUB(fp) (fp_ub._base != NULL) | 117 | # define HASUB(fp) (fp_ub._base != NULL) |
| 81 | 118 | ||
| 119 | # if defined __ANDROID__ /* Android */ | ||
| 120 | /* Needed after this commit from 2016-01-25 | ||
| 121 | <https://android.googlesource.com/platform/bionic.git/+/e70e0e9267d069bf56a5078c99307e08a7280de7> */ | ||
| 122 | # ifndef __SEOF | ||
| 123 | # define __SLBF 1 | ||
| 124 | # define __SNBF 2 | ||
| 125 | # define __SRD 4 | ||
| 126 | # define __SWR 8 | ||
| 127 | # define __SRW 0x10 | ||
| 128 | # define __SEOF 0x20 | ||
| 129 | # define __SERR 0x40 | ||
| 130 | # endif | ||
| 131 | # ifndef __SOFF | ||
| 132 | # define __SOFF 0x1000 | ||
| 133 | # endif | ||
| 134 | # endif | ||
| 135 | |||
| 82 | #endif | 136 | #endif |
| 83 | 137 | ||
| 84 | 138 | ||
| @@ -118,7 +172,7 @@ | |||
| 118 | # define _flag __flag | 172 | # define _flag __flag |
| 119 | # endif | 173 | # endif |
| 120 | 174 | ||
| 121 | #elif (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ /* newer Windows with MSVC */ | 175 | #elif defined _WIN32 && ! defined __CYGWIN__ /* newer Windows with MSVC */ |
| 122 | 176 | ||
| 123 | /* <stdio.h> does not define the innards of FILE any more. */ | 177 | /* <stdio.h> does not define the innards of FILE any more. */ |
| 124 | # define WINDOWS_OPAQUE_FILE | 178 | # define WINDOWS_OPAQUE_FILE |