1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
|
From a9766b7fd69768ec614f838edcb6a38fd7b3cb0d Mon Sep 17 00:00:00 2001
From: Keith Packard <keithp@keithp.com>
Date: Sun, 24 Jan 2021 14:20:33 -0800
Subject: [PATCH] Remove use of include_next from c++ headers
Using include_next bypasses the default header search path and lets
files later in the include path take priority over earlier files.
This makes replacing libc impossible as the default libc headers will
occur after the libstdc++ headers, and so be picked up in place of
headers inserted at the begining of the search path or appended to the
end of the search path.
Using include_next is a hack to work-around broken combinations of
libraries, and is not necessary in a well constructed toolchain.
Signed-off-by: Keith Packard <keithp@keithp.com>
---
libstdc++-v3/include/bits/std_abs.h | 4 ++--
libstdc++-v3/include/c/cassert | 2 +-
libstdc++-v3/include/c/cctype | 2 +-
libstdc++-v3/include/c/cerrno | 2 +-
libstdc++-v3/include/c/cfloat | 2 +-
libstdc++-v3/include/c/climits | 2 +-
libstdc++-v3/include/c/clocale | 2 +-
libstdc++-v3/include/c/cmath | 2 +-
libstdc++-v3/include/c/csetjmp | 2 +-
libstdc++-v3/include/c/csignal | 2 +-
libstdc++-v3/include/c/cstdarg | 2 +-
libstdc++-v3/include/c/cstddef | 2 +-
libstdc++-v3/include/c/cstdio | 2 +-
libstdc++-v3/include/c/cstdlib | 2 +-
libstdc++-v3/include/c/cstring | 2 +-
libstdc++-v3/include/c/ctime | 2 +-
libstdc++-v3/include/c/cuchar | 2 +-
libstdc++-v3/include/c/cwchar | 2 +-
libstdc++-v3/include/c/cwctype | 2 +-
libstdc++-v3/include/c_global/cmath | 2 +-
libstdc++-v3/include/c_global/cstdlib | 2 +-
21 files changed, 22 insertions(+), 22 deletions(-)
diff --git a/libstdc++-v3/include/bits/std_abs.h b/libstdc++-v3/include/bits/std_abs.h
index 48d44160baba..d30c44e51896 100644
--- a/libstdc++-v3/include/bits/std_abs.h
+++ b/libstdc++-v3/include/bits/std_abs.h
@@ -35,9 +35,9 @@
#include <bits/c++config.h>
#define _GLIBCXX_INCLUDE_NEXT_C_HEADERS
-#include_next <stdlib.h>
+#include <stdlib.h>
#ifdef __CORRECT_ISO_CPP_MATH_H_PROTO
-# include_next <math.h>
+# include <math.h>
#endif
#undef _GLIBCXX_INCLUDE_NEXT_C_HEADERS
diff --git a/libstdc++-v3/include/c/cassert b/libstdc++-v3/include/c/cassert
index 5cd11fff9ece..01d8c7fa5fcd 100644
--- a/libstdc++-v3/include/c/cassert
+++ b/libstdc++-v3/include/c/cassert
@@ -31,4 +31,4 @@
#pragma GCC system_header
#include <bits/c++config.h>
-#include_next <assert.h>
+#include <assert.h>
diff --git a/libstdc++-v3/include/c/cctype b/libstdc++-v3/include/c/cctype
index c6f650394357..1540a3259454 100644
--- a/libstdc++-v3/include/c/cctype
+++ b/libstdc++-v3/include/c/cctype
@@ -31,6 +31,6 @@
#pragma GCC system_header
-#include_next <ctype.h>
+#include <ctype.h>
#endif
diff --git a/libstdc++-v3/include/c/cerrno b/libstdc++-v3/include/c/cerrno
index 9e47b182d25c..250ea5d7744a 100644
--- a/libstdc++-v3/include/c/cerrno
+++ b/libstdc++-v3/include/c/cerrno
@@ -41,7 +41,7 @@
#pragma GCC system_header
#include <bits/c++config.h>
-#include_next <errno.h>
+#include <errno.h>
// Adhere to section 17.4.1.2 clause 5 of ISO 14882:1998
#ifndef errno
diff --git a/libstdc++-v3/include/c/cfloat b/libstdc++-v3/include/c/cfloat
index 81d9772ed9f6..660440fc810b 100644
--- a/libstdc++-v3/include/c/cfloat
+++ b/libstdc++-v3/include/c/cfloat
@@ -32,6 +32,6 @@
#pragma GCC system_header
#include <bits/c++config.h>
-#include_next <float.h>
+#include <float.h>
#endif
diff --git a/libstdc++-v3/include/c/climits b/libstdc++-v3/include/c/climits
index 255bed411259..919e1ec4855d 100644
--- a/libstdc++-v3/include/c/climits
+++ b/libstdc++-v3/include/c/climits
@@ -32,6 +32,6 @@
#pragma GCC system_header
#include <bits/c++config.h>
-#include_next <limits.h>
+#include <limits.h>
#endif
diff --git a/libstdc++-v3/include/c/clocale b/libstdc++-v3/include/c/clocale
index 4258df1958b6..95357d40ca1b 100644
--- a/libstdc++-v3/include/c/clocale
+++ b/libstdc++-v3/include/c/clocale
@@ -31,6 +31,6 @@
#pragma GCC system_header
-#include_next <locale.h>
+#include <locale.h>
#endif
diff --git a/libstdc++-v3/include/c/cmath b/libstdc++-v3/include/c/cmath
index 43020eee9d29..619031ba8e4a 100644
--- a/libstdc++-v3/include/c/cmath
+++ b/libstdc++-v3/include/c/cmath
@@ -33,7 +33,7 @@
#include <bits/c++config.h>
-#include_next <math.h>
+#include <math.h>
// Get rid of those macros defined in <math.h> in lieu of real functions.
#undef abs
diff --git a/libstdc++-v3/include/c/csetjmp b/libstdc++-v3/include/c/csetjmp
index 4a5b0334590f..4a7744ba1c7e 100644
--- a/libstdc++-v3/include/c/csetjmp
+++ b/libstdc++-v3/include/c/csetjmp
@@ -31,7 +31,7 @@
#pragma GCC system_header
-#include_next <setjmp.h>
+#include <setjmp.h>
// Get rid of those macros defined in <setjmp.h> in lieu of real functions.
#undef longjmp
diff --git a/libstdc++-v3/include/c/csignal b/libstdc++-v3/include/c/csignal
index 040b48368f94..afe91f7c7866 100644
--- a/libstdc++-v3/include/c/csignal
+++ b/libstdc++-v3/include/c/csignal
@@ -31,6 +31,6 @@
#pragma GCC system_header
-#include_next <signal.h>
+#include <signal.h>
#endif
diff --git a/libstdc++-v3/include/c/cstdarg b/libstdc++-v3/include/c/cstdarg
index 5d97e043da84..568dc07994f6 100644
--- a/libstdc++-v3/include/c/cstdarg
+++ b/libstdc++-v3/include/c/cstdarg
@@ -32,6 +32,6 @@
#pragma GCC system_header
#undef __need___va_list
-#include_next <stdarg.h>
+#include <stdarg.h>
#endif
diff --git a/libstdc++-v3/include/c/cstddef b/libstdc++-v3/include/c/cstddef
index 4fd889a1dffc..28997b73a647 100644
--- a/libstdc++-v3/include/c/cstddef
+++ b/libstdc++-v3/include/c/cstddef
@@ -35,6 +35,6 @@
#define __need_ptrdiff_t
#define __need_NULL
#define __need_offsetof
-#include_next <stddef.h>
+#include <stddef.h>
#endif
diff --git a/libstdc++-v3/include/c/cstdio b/libstdc++-v3/include/c/cstdio
index 01293054d501..6632e5b09586 100644
--- a/libstdc++-v3/include/c/cstdio
+++ b/libstdc++-v3/include/c/cstdio
@@ -31,7 +31,7 @@
#pragma GCC system_header
-#include_next <stdio.h>
+#include <stdio.h>
// Get rid of those macros defined in <stdio.h> in lieu of real functions.
#undef clearerr
diff --git a/libstdc++-v3/include/c/cstdlib b/libstdc++-v3/include/c/cstdlib
index f5707f8a8ce4..4156882e09aa 100644
--- a/libstdc++-v3/include/c/cstdlib
+++ b/libstdc++-v3/include/c/cstdlib
@@ -31,6 +31,6 @@
#pragma GCC system_header
-#include_next <stdlib.h>
+#include <stdlib.h>
#endif
diff --git a/libstdc++-v3/include/c/cstring b/libstdc++-v3/include/c/cstring
index 0082080fcab0..209ccd112faa 100644
--- a/libstdc++-v3/include/c/cstring
+++ b/libstdc++-v3/include/c/cstring
@@ -31,6 +31,6 @@
#pragma GCC system_header
-#include_next <string.h>
+#include <string.h>
#endif
diff --git a/libstdc++-v3/include/c/ctime b/libstdc++-v3/include/c/ctime
index 5476ff7da399..33c61aa08d73 100644
--- a/libstdc++-v3/include/c/ctime
+++ b/libstdc++-v3/include/c/ctime
@@ -31,6 +31,6 @@
#pragma GCC system_header
-#include_next <time.h>
+#include <time.h>
#endif
diff --git a/libstdc++-v3/include/c/cuchar b/libstdc++-v3/include/c/cuchar
index 430d1ff50ba1..7b2c9d738269 100644
--- a/libstdc++-v3/include/c/cuchar
+++ b/libstdc++-v3/include/c/cuchar
@@ -39,7 +39,7 @@
#include <cwchar>
#if _GLIBCXX_USE_C11_UCHAR_CXX11
-# include_next <uchar.h>
+# include <uchar.h>
#endif
#endif // C++11
diff --git a/libstdc++-v3/include/c/cwchar b/libstdc++-v3/include/c/cwchar
index 7a62eb74abbf..c1857099ef12 100644
--- a/libstdc++-v3/include/c/cwchar
+++ b/libstdc++-v3/include/c/cwchar
@@ -36,7 +36,7 @@
#include <ctime>
#if _GLIBCXX_HAVE_WCHAR_H
-#include_next <wchar.h>
+#include <wchar.h>
#endif
// Need to do a bit of trickery here with mbstate_t as char_traits
diff --git a/libstdc++-v3/include/c/cwctype b/libstdc++-v3/include/c/cwctype
index 011ceadbb1b4..6a67549ea4bd 100644
--- a/libstdc++-v3/include/c/cwctype
+++ b/libstdc++-v3/include/c/cwctype
@@ -34,7 +34,7 @@
#include <bits/c++config.h>
#if _GLIBCXX_HAVE_WCTYPE_H
-#include_next <wctype.h>
+#include <wctype.h>
#endif
#endif
diff --git a/libstdc++-v3/include/c_global/cmath b/libstdc++-v3/include/c_global/cmath
index 114b0693151e..bea5665a293d 100644
--- a/libstdc++-v3/include/c_global/cmath
+++ b/libstdc++-v3/include/c_global/cmath
@@ -44,7 +44,7 @@
#include <bits/cpp_type_traits.h>
#include <ext/type_traits.h>
#define _GLIBCXX_INCLUDE_NEXT_C_HEADERS
-#include_next <math.h>
+#include <math.h>
#undef _GLIBCXX_INCLUDE_NEXT_C_HEADERS
#include <bits/std_abs.h>
diff --git a/libstdc++-v3/include/c_global/cstdlib b/libstdc++-v3/include/c_global/cstdlib
index 7bb11f5b788a..5a6a28898221 100644
--- a/libstdc++-v3/include/c_global/cstdlib
+++ b/libstdc++-v3/include/c_global/cstdlib
@@ -76,7 +76,7 @@ namespace std
// Need to ensure this finds the C library's <stdlib.h> not a libstdc++
// wrapper that might already be installed later in the include search path.
#define _GLIBCXX_INCLUDE_NEXT_C_HEADERS
-#include_next <stdlib.h>
+#include <stdlib.h>
#undef _GLIBCXX_INCLUDE_NEXT_C_HEADERS
#include <bits/std_abs.h>
--
2.49.0
|