Mercurial > mxe-octave
comparison src/build-m4-glibc2-28.patch @ 4905:aa24b03ebb89
build-m4: Add patch for glibc >= 2.28 (bug #55214).
* src/build-m4-glibc2-28.patch: Add patch for m4 on systems with glibc >= 2.28.
* dist-files.mk: add ref to patch.
author | Markus Mützel <markus.muetzel@gmx.de> |
---|---|
date | Mon, 10 Dec 2018 21:32:21 +0100 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
4904:db053f858155 | 4905:aa24b03ebb89 |
---|---|
1 # This file is based on a Debian patch: | |
2 # https://launchpadlibrarian.net/392968582/m4_1.4.18-1_1.4.18-1ubuntu1.diff.gz | |
3 | |
4 diff -upr a/lib/fflush.c b/lib/fflush.c | |
5 --- a/lib/fflush.c 2016-12-31 21:54:41.000000000 +0800 | |
6 +++ b/lib/fflush.c 2018-08-08 16:12:40.522952171 +0800 | |
7 @@ -33,7 +33,7 @@ | |
8 #undef fflush | |
9 | |
10 | |
11 -#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ | |
12 +#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ | |
13 | |
14 /* Clear the stream's ungetc buffer, preserving the value of ftello (fp). */ | |
15 static void | |
16 @@ -72,7 +72,7 @@ clear_ungetc_buffer (FILE *fp) | |
17 | |
18 #endif | |
19 | |
20 -#if ! (defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */) | |
21 +#if ! (defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */) | |
22 | |
23 # if (defined __sferror || defined __DragonFly__ || defined __ANDROID__) && defined __SNPT | |
24 /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Android */ | |
25 @@ -148,7 +148,7 @@ rpl_fflush (FILE *stream) | |
26 if (stream == NULL || ! freading (stream)) | |
27 return fflush (stream); | |
28 | |
29 -#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ | |
30 +#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ | |
31 | |
32 clear_ungetc_buffer_preserving_position (stream); | |
33 | |
34 diff -upr a/lib/fpending.c b/lib/fpending.c | |
35 --- a/lib/fpending.c 2016-12-31 21:54:41.000000000 +0800 | |
36 +++ b/lib/fpending.c 2018-08-08 16:12:40.522952171 +0800 | |
37 @@ -32,7 +32,7 @@ __fpending (FILE *fp) | |
38 /* Most systems provide FILE as a struct and the necessary bitmask in | |
39 <stdio.h>, because they need it for implementing getc() and putc() as | |
40 fast macros. */ | |
41 -#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ | |
42 +#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ | |
43 return fp->_IO_write_ptr - fp->_IO_write_base; | |
44 #elif defined __sferror || defined __DragonFly__ || defined __ANDROID__ | |
45 /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Android */ | |
46 | |
47 diff -upr a/lib/fpurge.c b/lib/fpurge.c | |
48 --- a/lib/fpurge.c 2016-12-31 21:54:41.000000000 +0800 | |
49 +++ b/lib/fpurge.c 2018-08-08 16:12:40.522952171 +0800 | |
50 @@ -62,7 +62,7 @@ fpurge (FILE *fp) | |
51 /* Most systems provide FILE as a struct and the necessary bitmask in | |
52 <stdio.h>, because they need it for implementing getc() and putc() as | |
53 fast macros. */ | |
54 -# if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ | |
55 +# if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ | |
56 fp->_IO_read_end = fp->_IO_read_ptr; | |
57 fp->_IO_write_ptr = fp->_IO_write_base; | |
58 /* Avoid memory leak when there is an active ungetc buffer. */ | |
59 | |
60 diff -upr a/lib/freadahead.c b/lib/freadahead.c | |
61 --- a/lib/freadahead.c 2016-12-31 21:54:41.000000000 +0800 | |
62 +++ b/lib/freadahead.c 2018-08-08 16:12:40.522952171 +0800 | |
63 @@ -25,7 +25,7 @@ | |
64 size_t | |
65 freadahead (FILE *fp) | |
66 { | |
67 -#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ | |
68 +#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ | |
69 if (fp->_IO_write_ptr > fp->_IO_write_base) | |
70 return 0; | |
71 return (fp->_IO_read_end - fp->_IO_read_ptr) | |
72 | |
73 diff -upr a/lib/freading.c b/lib/freading.c | |
74 --- a/lib/freading.c 2016-12-31 21:54:41.000000000 +0800 | |
75 +++ b/lib/freading.c 2018-08-08 16:13:12.399618677 +0800 | |
76 @@ -31,7 +31,7 @@ freading (FILE *fp) | |
77 /* Most systems provide FILE as a struct and the necessary bitmask in | |
78 <stdio.h>, because they need it for implementing getc() and putc() as | |
79 fast macros. */ | |
80 -# if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ | |
81 +# if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ | |
82 return ((fp->_flags & _IO_NO_WRITES) != 0 | |
83 || ((fp->_flags & (_IO_NO_READS | _IO_CURRENTLY_PUTTING)) == 0 | |
84 && fp->_IO_read_base != NULL)); | |
85 | |
86 diff -upr a/lib/fseeko.c b/lib/fseeko.c | |
87 --- a/lib/fseeko.c 2016-12-31 21:54:41.000000000 +0800 | |
88 +++ b/lib/fseeko.c 2018-08-08 16:13:12.399618677 +0800 | |
89 @@ -47,7 +47,7 @@ fseeko (FILE *fp, off_t offset, int when | |
90 #endif | |
91 | |
92 /* These tests are based on fpurge.c. */ | |
93 -#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ | |
94 +#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ | |
95 if (fp->_IO_read_end == fp->_IO_read_ptr | |
96 && fp->_IO_write_ptr == fp->_IO_write_base | |
97 && fp->_IO_save_base == NULL) | |
98 @@ -123,7 +123,7 @@ fseeko (FILE *fp, off_t offset, int when | |
99 return -1; | |
100 } | |
101 | |
102 -#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ | |
103 +#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ | |
104 fp->_flags &= ~_IO_EOF_SEEN; | |
105 fp->_offset = pos; | |
106 #elif defined __sferror || defined __DragonFly__ || defined __ANDROID__ | |
107 | |
108 diff -upr a/lib/stdio-impl.h b/lib/stdio-impl.h | |
109 --- a/lib/stdio-impl.h 2016-12-31 21:54:41.000000000 +0800 | |
110 +++ b/lib/stdio-impl.h 2018-08-08 16:13:12.399618677 +0800 | |
111 @@ -18,6 +18,12 @@ | |
112 the same implementation of stdio extension API, except that some fields | |
113 have different naming conventions, or their access requires some casts. */ | |
114 | |
115 +/* Glibc 2.28 made _IO_IN_BACKUP private. For now, work around this | |
116 + problem by defining it ourselves. FIXME: Do not rely on glibc | |
117 + internals. */ | |
118 +#if !defined _IO_IN_BACKUP && defined _IO_EOF_SEEN | |
119 +# define _IO_IN_BACKUP 0x100 | |
120 +#endif | |
121 | |
122 /* BSD stdio derived implementations. */ | |
123 |