1 # 2013-02-07 Stefan Teleman <[email protected]> |
|
2 # Starting with S11.2, Solaris Standard C Library header files |
|
3 # are compliant with C++2003 and C++2011. Therefore the fixinclude |
|
4 # hacks provided below are no longer necessary. |
|
5 --- gcc-4.8.2/fixincludes/inclhack.def 2013-05-31 04:43:36.000000000 -0700 |
|
6 +++ gcc-4.8.2/fixincludes/inclhack.def 2013-10-17 11:13:57.773623647 -0700 |
|
7 @@ -317,63 +317,6 @@ |
|
8 _EndOfHeader_; |
|
9 }; |
|
10 |
|
11 - |
|
12 -/* |
|
13 - * Solaris <sys/varargs.h> is a DDK (aka kernel-land) header providing |
|
14 - * the same interface as <stdarg.h>. No idea why they couldn't have just |
|
15 - * used the standard header. |
|
16 - */ |
|
17 -fix = { |
|
18 - hackname = AAB_solaris_sys_varargs_h; |
|
19 - files = "sys/varargs.h"; |
|
20 - mach = '*-*-solaris*'; |
|
21 - replace = <<- _EndOfHeader_ |
|
22 - #ifdef __STDC__ |
|
23 - #include <stdarg.h> |
|
24 - #else |
|
25 - #include <varargs.h> |
|
26 - #endif |
|
27 - _EndOfHeader_; |
|
28 -}; |
|
29 - |
|
30 - |
|
31 -/* |
|
32 - * Fix non-ANSI memcpy declaration that conflicts with gcc's builtin |
|
33 - * declaration on Sun OS 4.x. We must only fix this on Sun OS 4.x, because |
|
34 - * many other systems have similar text but correct versions of the file. |
|
35 - * To ensure only Sun's is fixed, we grep for a likely unique string. |
|
36 - * Fix also on sysV68 R3V7.1 (head/memory.h\t50.1\t ) |
|
37 - */ |
|
38 -fix = { |
|
39 - hackname = AAB_sun_memcpy; |
|
40 - files = memory.h; |
|
41 - select = "/\\*\t@\\(#\\)" |
|
42 - "(head/memory.h\t50.1\t " |
|
43 - "|memory\\.h 1\\.[2-4] 8./../.. SMI; from S5R2 1\\.2\t)\\*/"; |
|
44 - |
|
45 - replace = <<- _EndOfHeader_ |
|
46 - /* This file was generated by fixincludes */ |
|
47 - #ifndef __memory_h__ |
|
48 - #define __memory_h__ |
|
49 - |
|
50 - #ifdef __STDC__ |
|
51 - extern void *memccpy(); |
|
52 - extern void *memchr(); |
|
53 - extern void *memcpy(); |
|
54 - extern void *memset(); |
|
55 - #else |
|
56 - extern char *memccpy(); |
|
57 - extern char *memchr(); |
|
58 - extern char *memcpy(); |
|
59 - extern char *memset(); |
|
60 - #endif /* __STDC__ */ |
|
61 - |
|
62 - extern int memcmp(); |
|
63 - |
|
64 - #endif /* __memory_h__ */ |
|
65 - _EndOfHeader_; |
|
66 -}; |
|
67 - |
|
68 /* |
|
69 * Fix assert.h on VxWorks: |
|
70 */ |
|
71 @@ -1774,35 +1717,6 @@ |
|
72 }; |
|
73 |
|
74 /* |
|
75 - * Fix these files to use the types we think they should for |
|
76 - * ptrdiff_t, size_t, and wchar_t. |
|
77 - * |
|
78 - * This defines the types in terms of macros predefined by our 'cpp'. |
|
79 - * This is supposedly necessary for glibc's handling of these types. |
|
80 - * It's probably not necessary for anyone else, but it doesn't hurt. |
|
81 - */ |
|
82 -fix = { |
|
83 - hackname = gnu_types; |
|
84 - files = "sys/types.h"; |
|
85 - files = "stdlib.h"; |
|
86 - files = "sys/stdtypes.h"; |
|
87 - files = "stddef.h"; |
|
88 - files = "memory.h"; |
|
89 - files = "unistd.h"; |
|
90 - bypass = '_GCC_(PTRDIFF|SIZE|WCHAR)_T'; |
|
91 - select = "^[ \t]*typedef[ \t]+.*[ \t](ptrdiff|size|wchar)_t;"; |
|
92 - c_fix = gnu_type; |
|
93 - /* The Solaris 10 headers already define these types correctly. */ |
|
94 - mach = '*-*-solaris2.1[0-9]*'; |
|
95 - not_machine = true; |
|
96 - |
|
97 - test_text = "typedef long int ptrdiff_t; /* long int */\n" |
|
98 - "typedef uint_t size_t; /* uint_t */\n" |
|
99 - "typedef ushort_t wchar_t; /* ushort_t */"; |
|
100 -}; |
|
101 - |
|
102 - |
|
103 -/* |
|
104 * Fix HP & Sony's use of "../machine/xxx.h" |
|
105 * to refer to: <machine/xxx.h> |
|
106 */ |
|
107 @@ -2667,39 +2581,6 @@ |
|
108 |
|
109 |
|
110 /* |
|
111 - * Some math.h files define struct exception (it's in the System V |
|
112 - * Interface Definition), which conflicts with the class exception defined |
|
113 - * in the C++ file std/stdexcept.h. We redefine it to __math_exception. |
|
114 - * This is not a great fix, but I haven't been able to think of anything |
|
115 - * better. |
|
116 - */ |
|
117 -fix = { |
|
118 - hackname = math_exception; |
|
119 - files = math.h; |
|
120 - select = "struct exception"; |
|
121 - /* |
|
122 - * This should be bypassed on __cplusplus, but some supposedly C++ |
|
123 - * aware headers, such as Solaris 8 and 9, don't wrap their struct |
|
124 - * exception either. So currently we bypass only for glibc, based on a |
|
125 - * comment in the fixed glibc header. Ick. |
|
126 - */ |
|
127 - bypass = 'We have a problem when using C\+\+|for C\+\+, ' |
|
128 - '_[a-z0-9A-Z_]+_exception; for C, exception'; |
|
129 - c_fix = wrap; |
|
130 - |
|
131 - c_fix_arg = "#ifdef __cplusplus\n" |
|
132 - "#define exception __math_exception\n" |
|
133 - "#endif\n"; |
|
134 - |
|
135 - c_fix_arg = "#ifdef __cplusplus\n" |
|
136 - "#undef exception\n" |
|
137 - "#endif\n"; |
|
138 - |
|
139 - test_text = "typedef struct exception t_math_exception;"; |
|
140 -}; |
|
141 - |
|
142 - |
|
143 -/* |
|
144 * This looks pretty broken to me. ``dbl_max_def'' will contain |
|
145 * "define DBL_MAX " at the start, when what we really want is just |
|
146 * the value portion. Can't figure out how to write a test case |
|
147 @@ -3164,653 +3045,6 @@ |
|
148 |
|
149 |
|
150 /* |
|
151 - * Solaris 10+ <sys/feature_tests.h> defines _RESTRICT_KYWD as restrict |
|
152 - * for C99. This is wrong for C++, which needs many C99 features, but |
|
153 - * only supports __restrict. |
|
154 - */ |
|
155 -fix = { |
|
156 - hackname = solaris___restrict; |
|
157 - files = sys/feature_tests.h; |
|
158 - select = "#define[ \t]*_RESTRICT_KYWD[ \t]*restrict"; |
|
159 - mach = "*-*-solaris2*"; |
|
160 - c_fix = format; |
|
161 - c_fix_arg = "#ifdef __cplusplus\n#define\t_RESTRICT_KYWD\t__restrict\n" |
|
162 - "#else\n%0\n#endif"; |
|
163 - test_text = "#define _RESTRICT_KYWD restrict"; |
|
164 -}; |
|
165 - |
|
166 - |
|
167 -/* |
|
168 - * Solaris 10+ complex.h defines _Complex_I and _Imaginary_I in terms of |
|
169 - * themselves, which are Sun Studio compiler intrinsics. Remove _Imaginary_I |
|
170 - * and imaginary definitions which are not supported by GCC. |
|
171 - */ |
|
172 -fix = { |
|
173 - hackname = solaris_complex; |
|
174 - mach = "*-*-solaris2.*"; |
|
175 - files = complex.h; |
|
176 - select = "#define[ \t]_Complex_I[ \t]_Complex_I"; |
|
177 - sed = "s/#define[ \t]_Complex_I[ \t]_Complex_I/" |
|
178 - "#define\t_Complex_I\t(__extension__ 1.0iF)/"; |
|
179 - sed = "/#define[ \t]_Imaginary_I[ \t]_Imaginary_I/d"; |
|
180 - sed = "/#define[ \t]imaginary[ \t]_Imaginary/d"; |
|
181 - sed = "s/#define[ \t]I[ \t]\\{1,\\}_Imaginary_I/#define\tI\t\t_Complex_I/"; |
|
182 - test_text = "#define _Complex_I _Complex_I\n" |
|
183 - "#define complex _Complex\n" |
|
184 - "#define _Imaginary_I _Imaginary_I\n" |
|
185 - "#define imaginary _Imaginary\n" |
|
186 - "#undef I\n" |
|
187 - "#define I _Imaginary_I"; |
|
188 -}; |
|
189 - |
|
190 - |
|
191 -/* |
|
192 - * Solaris 10+ <complex.h> is wrapped in #ifndef __cplusplus. Wrap in |
|
193 - * extern "C" instead so libstdc++ can use it. |
|
194 - */ |
|
195 -fix = { |
|
196 - hackname = solaris_complex_cxx; |
|
197 - mach = "*-*-solaris2.*"; |
|
198 - files = complex.h; |
|
199 - sed = "/#if[ \t]*!defined(__cplusplus)/c\\\n" |
|
200 - "#ifdef\t__cplusplus\\\nextern \"C\" {\\\n#endif"; |
|
201 - sed = "/#endif[ \t]*\\/\\* !defined(__cplusplus) \\*\\//c\\\n" |
|
202 - "#ifdef\t__cplusplus\\\n}\\\n#endif"; |
|
203 - test_text = "#if !defined(__cplusplus)\n" |
|
204 - "#endif /* !defined(__cplusplus) */"; |
|
205 -}; |
|
206 - |
|
207 - |
|
208 -/* |
|
209 - * g++ rejects functions declared with both C and C++ linkage. |
|
210 - */ |
|
211 -fix = { |
|
212 - hackname = solaris_cxx_linkage; |
|
213 - mach = '*-*-solaris2*'; |
|
214 - files = "iso/stdlib_iso.h"; |
|
215 - select = "(#if __cplusplus >= 199711L)\n" |
|
216 - "(extern \"C\\+\\+\" \\{\n)" |
|
217 - "(.*(bsearch|qsort).*)"; |
|
218 - c_fix = format; |
|
219 - c_fix_arg = "%1 && !__GNUG__\n%2%3"; |
|
220 - |
|
221 - test_text = |
|
222 - "#if __cplusplus >= 199711L\n" |
|
223 - "extern \"C++\" {\n" |
|
224 - " void *bsearch(const void *, const void *, size_t, size_t,"; |
|
225 -}; |
|
226 - |
|
227 - |
|
228 -/* |
|
229 - * Solaris <iso/stdio_iso.h> doesn't declare getc for C++ with |
|
230 - * _STRICT_STDC, but uses it. |
|
231 - */ |
|
232 -fix = { |
|
233 - hackname = solaris_getc_strict_stdc; |
|
234 - mach = "*-*-solaris2*"; |
|
235 - files = "iso/stdio_iso.h"; |
|
236 - select = "(.*&& )!defined\\(_STRICT_STDC\\)(.*)"; |
|
237 - c_fix = format; |
|
238 - c_fix_arg = "%1(!defined(_STRICT_STDC) || (__cplusplus >= 199711L))%2"; |
|
239 - |
|
240 - test_text = |
|
241 - "#if !defined(_REENTRANT) && !defined(_LP64) && !defined(_STRICT_STDC)"; |
|
242 -}; |
|
243 - |
|
244 - |
|
245 -/* |
|
246 - * Before Solaris 10, <iso/setjmp_iso.h> doesn't mark longjump noreturn. |
|
247 - */ |
|
248 -fix = { |
|
249 - hackname = solaris_longjmp_noreturn; |
|
250 - mach = "*-*-solaris2*"; |
|
251 - files = "iso/setjmp_iso.h"; |
|
252 - bypass = "__NORETURN"; |
|
253 - select = "(.*longjmp\\(jmp_buf.*[^)]+\\));"; |
|
254 - c_fix = format; |
|
255 - c_fix_arg = "%1 __attribute__ ((__noreturn__));"; |
|
256 - |
|
257 - test_text = "extern void longjmp(jmp_buf, int);"; |
|
258 -}; |
|
259 - |
|
260 - |
|
261 -/* |
|
262 - * Sun Solaris 10 defines several C99 math macros in terms of |
|
263 - * builtins specific to the Studio compiler, in particular not |
|
264 - * compatible with the GNU compiler. |
|
265 - */ |
|
266 -fix = { |
|
267 - hackname = solaris_math_1; |
|
268 - select = '@\(#\)math_c99.h' "[ \t]+1.[0-9]+[ \t]+[0-9/]+ SMI"; |
|
269 - bypass = "__GNUC__"; |
|
270 - files = iso/math_c99.h; |
|
271 - c_fix = format; |
|
272 - c_fix_arg = "#define\tHUGE_VA%1\t(__builtin_huge_va%2())"; |
|
273 - c_fix_arg = "^#define[ \t]+HUGE_VA([LF]+)[ \t]+__builtin_huge_va([lf]+)"; |
|
274 - test_text = |
|
275 - '#ident "@(#)math_c99.h 1.9 04/11/01 SMI"'"\n" |
|
276 - "#undef HUGE_VAL\n" |
|
277 - "#define HUGE_VAL __builtin_huge_val\n" |
|
278 - "#undef HUGE_VALF\n" |
|
279 - "#define HUGE_VALF __builtin_huge_valf\n" |
|
280 - "#undef HUGE_VALL\n" |
|
281 - "#define HUGE_VALL __builtin_huge_vall"; |
|
282 -}; |
|
283 - |
|
284 -fix = { |
|
285 - hackname = solaris_math_2; |
|
286 - select = '@\(#\)math_c99.h' "[ \t]+1.[0-9]+[ \t]+[0-9/]+ SMI"; |
|
287 - bypass = "__GNUC__"; |
|
288 - files = iso/math_c99.h; |
|
289 - c_fix = format; |
|
290 - c_fix_arg = "#define\tINFINITY\t(__builtin_inff())"; |
|
291 - c_fix_arg = "^#define[ \t]+INFINITY[ \t]+__builtin_infinity"; |
|
292 - test_text = |
|
293 - '#ident "@(#)math_c99.h 1.9 04/11/01 SMI"'"\n" |
|
294 - "#undef INFINITY\n" |
|
295 - "#define INFINITY __builtin_infinity"; |
|
296 -}; |
|
297 - |
|
298 -fix = { |
|
299 - hackname = solaris_math_3; |
|
300 - select = '@\(#\)math_c99.h' "[ \t]+1.[0-9]+[ \t]+[0-9/]+ SMI"; |
|
301 - bypass = "__GNUC__"; |
|
302 - files = iso/math_c99.h; |
|
303 - c_fix = format; |
|
304 - c_fix_arg = "#define\tNAN\t\t(__builtin_nanf(\"\"))"; |
|
305 - c_fix_arg = "^#define[ \t]+NAN[ \t]+__builtin_nan"; |
|
306 - test_text = |
|
307 - '#ident "@(#)math_c99.h 1.9 04/11/01 SMI"'"\n" |
|
308 - "#undef NAN\n" |
|
309 - "#define NAN __builtin_nan"; |
|
310 -}; |
|
311 - |
|
312 -fix = { |
|
313 - hackname = solaris_math_4; |
|
314 - select = '@\(#\)math_c99.h' "[ \t]+1.[0-9]+[ \t]+[0-9/]+ SMI"; |
|
315 - bypass = "__GNUC__"; |
|
316 - files = iso/math_c99.h; |
|
317 - c_fix = format; |
|
318 - c_fix_arg = "#define\tfpclassify(x) \\\n" |
|
319 - " __builtin_fpclassify(FP_NAN, FP_INFINITE, FP_NORMAL, FP_SUBNORMAL, FP_ZERO, (x))"; |
|
320 - c_fix_arg = "^#define[ \t]+fpclassify\\(x\\)[ \t]+__builtin_fpclassify\\(x\\)"; |
|
321 - test_text = |
|
322 - '#ident "@(#)math_c99.h 1.9 04/11/01 SMI"'"\n" |
|
323 - "#undef fpclassify\n" |
|
324 - "#define fpclassify(x) __builtin_fpclassify(x)"; |
|
325 -}; |
|
326 - |
|
327 -fix = { |
|
328 - hackname = solaris_math_8; |
|
329 - select = '@\(#\)math_c99\.h' "[ \t]+1\\.[0-9]+[ \t]+[0-9/]+ SMI"; |
|
330 - bypass = "__GNUC__"; |
|
331 - files = iso/math_c99.h; |
|
332 - c_fix = format; |
|
333 - c_fix_arg = "#define\tsignbit(x)\t(sizeof(x) == sizeof(float) \\\n" |
|
334 - "\t\t\t ? __builtin_signbitf(x) \\\n" |
|
335 - "\t\t\t : sizeof(x) == sizeof(long double) \\\n" |
|
336 - "\t\t\t ? __builtin_signbitl(x) \\\n" |
|
337 - "\t\t\t : __builtin_signbit(x))"; |
|
338 - c_fix_arg = "^#define[ \t]+signbit\\(x\\)[ \t]+__builtin_signbit\\(x\\)"; |
|
339 - test_text = <<- _EOText_ |
|
340 - #ident "@(#)math_c99.h 1.9 04/11/01 SMI" |
|
341 - #undef signbit |
|
342 - #define signbit(x) __builtin_signbit(x) |
|
343 - _EOText_; |
|
344 -}; |
|
345 - |
|
346 -fix = { |
|
347 - hackname = solaris_math_9; |
|
348 - select = '@\(#\)math_c99.h' "[ \t]+1.[0-9]+[ \t]+[0-9/]+ SMI"; |
|
349 - bypass = "__GNUC__"; |
|
350 - files = iso/math_c99.h; |
|
351 - c_fix = format; |
|
352 - c_fix_arg = "#define\t%1(x, y)%2__builtin_%1(x, y)"; |
|
353 - c_fix_arg = "^#define[ \t]+([a-z]+)\\(x, y\\)([ \t]+)\\(\\(x\\) __builtin_[a-z]+\\(y\\)\\)"; |
|
354 - test_text = |
|
355 - '#ident "@(#)math_c99.h 1.9 04/11/01 SMI"'"\n" |
|
356 - "#undef isgreater\n" |
|
357 - "#define isgreater(x, y) ((x) __builtin_isgreater(y))\n" |
|
358 - "#undef isgreaterequal\n" |
|
359 - "#define isgreaterequal(x, y) ((x) __builtin_isgreaterequal(y))\n" |
|
360 - "#undef isless\n" |
|
361 - "#define isless(x, y) ((x) __builtin_isless(y))\n" |
|
362 - "#undef islessequal\n" |
|
363 - "#define islessequal(x, y) ((x) __builtin_islessequal(y))\n" |
|
364 - "#undef islessgreater\n" |
|
365 - "#define islessgreater(x, y) ((x) __builtin_islessgreater(y))\n" |
|
366 - "#undef isunordered\n" |
|
367 - "#define isunordered(x, y) ((x) __builtin_isunordered(y))"; |
|
368 -}; |
|
369 - |
|
370 -/* |
|
371 - * On Solaris 11, if you do isinf(NaN) you'll get a floating point |
|
372 - * exception. Provide an alternative using GCC's builtin. |
|
373 - */ |
|
374 - |
|
375 -fix = { |
|
376 - hackname = solaris_math_10; |
|
377 - select = '@\(#\)math_c99.h' "[ \t]+1.[0-9]+[ \t]+[0-9/]+ SMI"; |
|
378 - files = iso/math_c99.h; |
|
379 - c_fix = format; |
|
380 - c_fix_arg = "#define\tisinf(x) __builtin_isinf(x)"; |
|
381 - c_fix_arg = "^#define[ \t]+isinf\\(x\\)[ \t]+__extension__\\([ \t]*\\\\\n" |
|
382 - "[ \t]*\\{[ \t]*__typeof\\(x\\)[ \t]*__x_i[ \t]*=[ \t]*\\(x\\);[ \t]*\\\\\n" |
|
383 - "[ \t]*__x_i[ \t]*==[ \t]*\\(__typeof\\(__x_i\\)\\)[ \t]*INFINITY[ \t]*\\|\\|[ \t]*\\\\\n" |
|
384 - "[ \t]*__x_i[ \t]*==[ \t]*\\(__typeof\\(__x_i\\)\\)[ \t]*\\(-INFINITY\\);[ \t]*\\}\\)"; |
|
385 - test_text = |
|
386 - '#pragma ident "@(#)math_c99.h 1.12 07/01/21 SMI"'"\n" |
|
387 - "#undef isinf\n" |
|
388 - "#define isinf(x) __extension__( \\\\\n" |
|
389 - " { __typeof(x) __x_i = (x); \\\\\n" |
|
390 - " __x_i == (__typeof(__x_i)) INFINITY || \\\\\n" |
|
391 - " __x_i == (__typeof(__x_i)) (-INFINITY); })"; |
|
392 -}; |
|
393 - |
|
394 -/* |
|
395 - * Sun Solaris defines PTHREAD_MUTEX_INITIALIZER with a trailing |
|
396 - * "0" for the last field of the pthread_mutex_t structure, which is |
|
397 - * of type upad64_t, which itself is typedef'd to int64_t, but with |
|
398 - * __STDC__ defined (e.g. by -ansi) it is a union. So change the |
|
399 - * initializer to "{0}" instead |
|
400 - */ |
|
401 -fix = { |
|
402 - hackname = solaris_mutex_init_2; |
|
403 - select = '@\(#\)pthread.h' "[ \t]+1.[0-9]+[ \t]+[0-9/]+ SMI"; |
|
404 - files = pthread.h; |
|
405 - /* |
|
406 - * On Solaris 10, this fix is unnecessary because upad64_t is |
|
407 - * always defined correctly regardless of the definition of the |
|
408 - * __STDC__ macro. The first "mach" pattern matches up to |
|
409 - * solaris9. The second "mach" pattern will not match any two (or |
|
410 - * more) digit solaris version, but it will match e.g. 2.5.1. |
|
411 - */ |
|
412 - mach = '*-*-solaris2.[0-9]', '*-*-solaris2.[0-9][!0-9]*'; |
|
413 - c_fix = format; |
|
414 - c_fix_arg = "#if __STDC__ - 0 == 0 && !defined(_NO_LONGLONG)\n" |
|
415 - "%0\n" |
|
416 - "#else\n" |
|
417 - "%1, {0}}%4\n" |
|
418 - "#endif"; |
|
419 - c_fix_arg = "(^#define[ \t]+PTHREAD_(MUTEX|COND)_INITIALIZER[ \t]+" |
|
420 - "(|/\*.*\*/[ \t]*\\\\\n[ \t]*)\\{.*)" |
|
421 - ",[ \t]*0\\}" "(|[ \t].*)$"; |
|
422 - test_text = |
|
423 - '#ident "@(#)pthread.h 1.26 98/04/12 SMI"'"\n" |
|
424 - "#define PTHREAD_MUTEX_INITIALIZER\t{{{0},0}, {{{0}}}, 0}\n" |
|
425 - "#define PTHREAD_COND_INITIALIZER\t{{{0}, 0}, 0}\t/* DEFAULTCV */\n" |
|
426 - "#define PTHREAD_MUTEX_INITIALIZER /* = DEFAULTMUTEX */ \\\\\n" |
|
427 - " {{0, 0, 0, DEFAULT_TYPE, _MUTEX_MAGIC}, {{{0}}}, 0}\n" |
|
428 - "#define PTHREAD_COND_INITIALIZER /* = DEFAULTCV */ \\\\\n" |
|
429 - " {{{0, 0, 0, 0}, DEFAULT_TYPE, _COND_MAGIC}, 0}"; |
|
430 -}; |
|
431 - |
|
432 - |
|
433 -/* |
|
434 - * The pow overloads with int were removed in C++ 2011 DR 550. |
|
435 - */ |
|
436 -fix = { |
|
437 - hackname = solaris_pow_int_overload; |
|
438 - mach = '*-*-solaris2*'; |
|
439 - files = "iso/math_iso.h"; |
|
440 - select = "^[ \t]*inline [a-z ]* pow\\([^()]*, int [^()]*\\)" |
|
441 - " *\\{[^{}]*\n[^{}]*\\}"; |
|
442 - c_fix = format; |
|
443 - c_fix_arg = "#if __cplusplus < 201103L\n%0\n#endif"; |
|
444 - |
|
445 - test_text = |
|
446 - " inline long double pow(long double __X, int __Y) { return\n" |
|
447 - " __powl(__X, (long double) (__Y)); }"; |
|
448 -}; |
|
449 - |
|
450 - |
|
451 -/* |
|
452 - * Sun Solaris defines PTHREAD_RWLOCK_INITIALIZER with a "0" for some |
|
453 - * fields of the pthread_rwlock_t structure, which are of type |
|
454 - * upad64_t, which itself is typedef'd to int64_t, but with __STDC__ |
|
455 - * defined (e.g. by -ansi) it is a union. So change the initializer |
|
456 - * to "{0}" instead. |
|
457 - */ |
|
458 -fix = { |
|
459 - hackname = solaris_rwlock_init_1; |
|
460 - select = '@\(#\)pthread.h' "[ \t]+1.[0-9]+[ \t]+[0-9/]+ SMI"; |
|
461 - files = pthread.h; |
|
462 - mach = '*-*-solaris*'; |
|
463 - c_fix = format; |
|
464 - c_fix_arg = "#if __STDC__ - 0 == 0 && !defined(_NO_LONGLONG)\n" |
|
465 - "%0\n" |
|
466 - "#else\n" |
|
467 - "%1{0, 0, 0, {{0}, {0}, {0}}, {{0}, {0}}, {{0}, {0}}}\n" |
|
468 - "#endif"; |
|
469 - c_fix_arg = "(^#define[ \t]+PTHREAD_RWLOCK_INITIALIZER[ \t]+)" |
|
470 - "\\{0, 0, 0, \\{0, 0, 0\\}, \\{0, 0\\}, \\{0, 0\\}\\}[ \t]*$"; |
|
471 - |
|
472 - test_text = |
|
473 - '#ident "@(#)pthread.h 1.26 98/04/12 SMI"'"\n" |
|
474 - "#define PTHREAD_RWLOCK_INITIALIZER\t{0, 0, 0, {0, 0, 0}, {0, 0}, {0, 0}}"; |
|
475 -}; |
|
476 - |
|
477 - |
|
478 -/* |
|
479 - * Sun Solaris defines PTHREAD_ONCE_INIT as an array containing a |
|
480 - * structure. As such, it need two levels of brackets, but only |
|
481 - * contains one. Wrap the macro definition in an extra layer. |
|
482 - */ |
|
483 -fix = { |
|
484 - hackname = solaris_once_init_1; |
|
485 - select = '@\(#\)pthread.h' "[ \t]+1.[0-9]+[ \t]+[0-9/]+ SMI"; |
|
486 - files = pthread.h; |
|
487 - mach = '*-*-solaris*'; |
|
488 - c_fix = format; |
|
489 - c_fix_arg = "%1{%2}%3"; |
|
490 - c_fix_arg = "(^#define[ \t]+PTHREAD_ONCE_INIT[ \t]+\\{)([^}]+)(\\})[ \t]*$"; |
|
491 - test_text = |
|
492 - '#pragma ident "@(#)pthread.h 1.37 04/09/28 SMI"'"\n" |
|
493 - "#define PTHREAD_ONCE_INIT\t{0, 0, 0, PTHREAD_ONCE_NOTDONE}"; |
|
494 -}; |
|
495 - |
|
496 - |
|
497 -/* |
|
498 - * Sun Solaris defines PTHREAD_ONCE_INIT with a "0" for some |
|
499 - * fields of the pthread_once_t structure, which are of type |
|
500 - * upad64_t, which itself is typedef'd to int64_t, but with __STDC__ |
|
501 - * defined (e.g. by -ansi) it is a union. So change the initializer |
|
502 - * to "{0}" instead. This test relies on solaris_once_init_1. |
|
503 - */ |
|
504 -fix = { |
|
505 - hackname = solaris_once_init_2; |
|
506 - select = '@\(#\)pthread.h' "[ \t]+1.[0-9]+[ \t]+[0-9/]+ SMI"; |
|
507 - files = pthread.h; |
|
508 - /* |
|
509 - * On Solaris 10, this fix is unnecessary because upad64_t is |
|
510 - * always defined correctly regardless of the definition of the |
|
511 - * __STDC__ macro. The first "mach" pattern matches up to |
|
512 - * solaris9. The second "mach" pattern will not match any two (or |
|
513 - * more) digit solaris version, but it will match e.g. 2.5.1. |
|
514 - */ |
|
515 - mach = '*-*-solaris2.[0-9]', '*-*-solaris2.[0-9][!0-9]*'; |
|
516 - c_fix = format; |
|
517 - c_fix_arg = "#if __STDC__ - 0 == 0 && !defined(_NO_LONGLONG)\n" |
|
518 - "%0\n" |
|
519 - "#else\n" |
|
520 - "%1{0}, {0}, {0}, {%3}%4\n" |
|
521 - "#endif"; |
|
522 - c_fix_arg = "(^#define[ \t]+PTHREAD_ONCE_INIT[ \t]+\\{\\{)" |
|
523 - "(0, 0, 0, )(PTHREAD_[A-Z_]+)(\\}\\})[ \t]*$"; |
|
524 - test_text = |
|
525 - '#ident "@(#)pthread.h 1.26 98/04/12 SMI"'"\n" |
|
526 - "#define PTHREAD_ONCE_INIT\t{{0, 0, 0, PTHREAD_ONCE_NOTDONE}}\n"; |
|
527 -}; |
|
528 - |
|
529 - |
|
530 -/* |
|
531 - * Sun Solaris 2 has a version of sys/int_const.h that defines |
|
532 - * UINT8_C and UINT16_C to unsigned constants. |
|
533 - */ |
|
534 -fix = { |
|
535 - hackname = solaris_int_const; |
|
536 - files = sys/int_const.h; |
|
537 - mach = '*-*-solaris2*'; |
|
538 - c_fix = format; |
|
539 - c_fix_arg = "#define\tUINT8_C(c)\t(c)\n" |
|
540 - "%1\n" |
|
541 - "#define\tUINT16_C(c)\t(c)"; |
|
542 - select = "^#define[ \t]+UINT8_C\\(c\\)[ \t]+__CONCAT__.*\n" |
|
543 - "(/\*.*\*/)\n" |
|
544 - "#define[ \t]+UINT16_C\\(c\\)[ \t]+__CONCAT__.*"; |
|
545 - test_text = |
|
546 - "#define UINT8_C(c) __CONCAT__(c,u)\n" |
|
547 - "/* CSTYLED */\n" |
|
548 - "#define UINT16_C(c) __CONCAT__(c,u)"; |
|
549 -}; |
|
550 - |
|
551 - |
|
552 -/* |
|
553 - * Sun Solaris 2 has a version of sys/int_limits.h that defines |
|
554 - * UINT8_MAX and UINT16_MAX to unsigned constants. |
|
555 - */ |
|
556 -fix = { |
|
557 - hackname = solaris_int_limits_1; |
|
558 - files = sys/int_limits.h; |
|
559 - mach = '*-*-solaris2*'; |
|
560 - c_fix = format; |
|
561 - c_fix_arg = "#define\tUINT8_MAX\t(255)\n" |
|
562 - "#define\tUINT16_MAX\t(65535)"; |
|
563 - select = "^#define[ \t]+UINT8_MAX[ \t]+\\(255U\\)\n" |
|
564 - "#define[ \t]+UINT16_MAX[ \t]+\\(65535U\\)"; |
|
565 - test_text = |
|
566 - "#define UINT8_MAX (255U)\n" |
|
567 - "#define UINT16_MAX (65535U)"; |
|
568 -}; |
|
569 - |
|
570 - |
|
571 -/* |
|
572 - * Sun Solaris 2 has a version of sys/int_limits.h that defines |
|
573 - * INT_FAST16 limits to wrong values for sys/int_types.h. |
|
574 - */ |
|
575 -fix = { |
|
576 - hackname = solaris_int_limits_2; |
|
577 - files = sys/int_limits.h; |
|
578 - mach = '*-*-solaris2*'; |
|
579 - c_fix = format; |
|
580 - c_fix_arg = "#define\t%1_FAST16_%2 %132_%2"; |
|
581 - select = "^#define[ \t]+(INT|UINT)_FAST16_(MAX|MIN)[ \t](INT|UINT)16.*"; |
|
582 - test_text = |
|
583 - "#define INT_FAST16_MAX INT16_MAX\n" |
|
584 - "#define UINT_FAST16_MAX UINT16_MAX\n" |
|
585 - "#define INT_FAST16_MIN INT16_MIN"; |
|
586 -}; |
|
587 - |
|
588 - |
|
589 -/* |
|
590 - * Sun Solaris 2 has a version of sys/int_limits.h that defines |
|
591 - * SIZE_MAX as unsigned long. |
|
592 - */ |
|
593 -fix = { |
|
594 - hackname = solaris_int_limits_3; |
|
595 - files = sys/int_limits.h; |
|
596 - mach = '*-*-solaris2*'; |
|
597 - c_fix = format; |
|
598 - c_fix_arg = "#define\tSIZE_MAX\t4294967295U"; |
|
599 - select = "^#define[ \t]+SIZE_MAX[ \t]+4294967295UL"; |
|
600 - test_text = |
|
601 - "#define SIZE_MAX 4294967295UL"; |
|
602 -}; |
|
603 - |
|
604 - |
|
605 -/* |
|
606 - * Sun Solaris up to 9 has a version of sys/int_types.h that forbids use |
|
607 - * of Standard C99 64-bit types in 32-bit mode. |
|
608 - */ |
|
609 -fix = { |
|
610 - hackname = solaris_int_types; |
|
611 - select = "__STDC__ - 0 == 0"; |
|
612 - bypass = "_LONGLONG_TYPE"; |
|
613 - files = sys/int_types.h; |
|
614 - c_fix = format; |
|
615 - c_fix_arg = |
|
616 - "(defined(_STDC_C99) || !defined(_STRICT_STDC) || defined(__GNUC__))"; |
|
617 - test_text = |
|
618 - "#if __STDC__ - 0 == 0 && !defined(_NO_LONGLONG)\n" |
|
619 - "typedef long long int64_t;\n" |
|
620 - "#endif\n\n" |
|
621 - "#if defined(_LP64) || (__STDC__ - 0 == 0 && !defined(_NO_LONGLONG))\n" |
|
622 - "typedef int64_t intmax_t;\n" |
|
623 - "#endif"; |
|
624 -}; |
|
625 - |
|
626 - |
|
627 -/* |
|
628 - * Solaris 10+ <spawn.h> uses char *const argv[_RESTRICT_KYWD] in the |
|
629 - * posix_spawn declarations, which doesn't work with C++. |
|
630 - */ |
|
631 -fix = { |
|
632 - hackname = solaris_posix_spawn_restrict; |
|
633 - files = spawn.h; |
|
634 - mach = '*-*-solaris2*'; |
|
635 - c_fix = format; |
|
636 - c_fix_arg = "%1*_RESTRICT_KYWD %2%3"; |
|
637 - select = "(.*[ \t]+)([a-z]+)\\[_RESTRICT_KYWD\\](.*)"; |
|
638 - test_text = |
|
639 - "char *const argv[_RESTRICT_KYWD],\n" |
|
640 - "char *const envp[_RESTRICT_KYWD]);"; |
|
641 -}; |
|
642 - |
|
643 - |
|
644 -/* |
|
645 - * Before Solaris 10, <stdio.h> lacks declarations of std::__filbuf and |
|
646 - * std::__flsbuf, but <iso/stdio_iso.h> uses them. |
|
647 - */ |
|
648 -fix = { |
|
649 - hackname = solaris_std___filbuf; |
|
650 - files = stdio.h; |
|
651 - mach = '*-*-solaris2*'; |
|
652 - bypass = "using std::__filbuf"; |
|
653 - select = "(using std::perror;\n)(#endif)"; |
|
654 - c_fix = format; |
|
655 - c_fix_arg = "%1#ifndef _LP64\n" |
|
656 - "using std::__filbuf;\n" |
|
657 - "using std::__flsbuf;\n" |
|
658 - "#endif\n%2"; |
|
659 - |
|
660 - test_text = "using std::perror;\n" |
|
661 - "#endif"; |
|
662 -}; |
|
663 - |
|
664 - |
|
665 -/* |
|
666 - * Sun Solaris 8 has what appears to be some gross workaround for |
|
667 - * some old version of their c++ compiler. G++ doesn't want it |
|
668 - * either, but doesn't want to be tied to SunPRO version numbers. |
|
669 - */ |
|
670 -fix = { |
|
671 - hackname = solaris_stdio_tag; |
|
672 - files = stdio_tag.h; |
|
673 - |
|
674 - select = '__cplusplus < 54321L'; |
|
675 - /* In Solaris 10, the code in stdio_tag.h is conditionalized on |
|
676 - "!defined(__GNUC__)" so we no longer need to fix it. */ |
|
677 - bypass = '__GNUC__'; |
|
678 - sed = 's/defined(__cplusplus) && (__cplusplus < 54321L)/0/'; |
|
679 - |
|
680 - test_text = "#if\tdefined(__cplusplus) && (__cplusplus < 54321L)"; |
|
681 -}; |
|
682 - |
|
683 - |
|
684 -/* |
|
685 - * On Solaris 9, __va_list needs to become a typedef for |
|
686 - * __builtin_va_list to make -Wmissing-format-attribute work. |
|
687 - */ |
|
688 -fix = { |
|
689 - hackname = solaris_sys_va_list; |
|
690 - files = sys/va_list.h; |
|
691 - mach = '*-*-solaris2.9'; |
|
692 - select = "#if.*__STDC__.*\n" |
|
693 - "typedef void \\*__va_list;\n" |
|
694 - "#else\n" |
|
695 - "typedef char \\*__va_list;\n" |
|
696 - "#endif"; |
|
697 - |
|
698 - c_fix = format; |
|
699 - c_fix_arg = "#ifdef __GNUC__\n" |
|
700 - "typedef __builtin_va_list __va_list;\n" |
|
701 - "#else\n" |
|
702 - "%0\n" |
|
703 - "#endif"; |
|
704 - test_text = "#if defined(__STDC__) && !defined(__ia64)\n" |
|
705 - "typedef void *__va_list;\n" |
|
706 - "#else\n" |
|
707 - "typedef char *__va_list;\n" |
|
708 - "#endif"; |
|
709 -}; |
|
710 - |
|
711 - |
|
712 -/* |
|
713 - * a missing semi-colon at the end of the statsswtch structure definition. |
|
714 - */ |
|
715 -fix = { |
|
716 - hackname = statsswtch; |
|
717 - files = rpcsvc/rstat.h; |
|
718 - select = "boottime$"; |
|
719 - c_fix = format; |
|
720 - c_fix_arg = "boottime;"; |
|
721 - test_text = "struct statswtch {\n int boottime\n};"; |
|
722 -}; |
|
723 - |
|
724 - |
|
725 -/* |
|
726 - * Arrange for stdio.h to use stdarg.h to define __gnuc_va_list. |
|
727 - * On 4BSD-derived systems, stdio.h defers to machine/ansi.h; that's |
|
728 - * OK too. |
|
729 - */ |
|
730 -fix = { |
|
731 - hackname = stdio_stdarg_h; |
|
732 - files = stdio.h; |
|
733 - bypass = "include.*(stdarg\.h|machine/ansi\.h)"; |
|
734 - /* |
|
735 - * On Solaris 10, this fix is unncessary; <stdio.h> includes |
|
736 - * <iso/stdio_iso.h>, which includes <sys/va_list.h>. |
|
737 - */ |
|
738 - mach = '*-*-solaris2.1[0-9]*'; |
|
739 - not_machine = true; |
|
740 - |
|
741 - c_fix = wrap; |
|
742 - |
|
743 - c_fix_arg = "#define __need___va_list\n#include <stdarg.h>\n"; |
|
744 - |
|
745 - test_text = ""; |
|
746 -}; |
|
747 - |
|
748 - |
|
749 -/* |
|
750 - * Don't use or define the name va_list in stdio.h. This is for |
|
751 - * ANSI. Note _BSD_VA_LIST_ is dealt with elsewhere. The presence |
|
752 - * of __gnuc_va_list, __DJ_va_list, or _G_va_list is taken to |
|
753 - * indicate that the header knows what it's doing -- under SUSv2, |
|
754 - * stdio.h is required to define va_list, and we shouldn't break |
|
755 - * that. |
|
756 - */ |
|
757 -fix = { |
|
758 - hackname = stdio_va_list; |
|
759 - files = stdio.h; |
|
760 - bypass = '__gnuc_va_list|_BSD_VA_LIST_|__DJ_va_list|_G_va_list'; |
|
761 - /* |
|
762 - * On Solaris 10, the definition in |
|
763 - * <stdio.h> is guarded appropriately by the _XPG4 feature macro; |
|
764 - * there is therefore no need for this fix there. |
|
765 - */ |
|
766 - mach = '*-*-solaris2.1[0-9]*'; |
|
767 - not_machine = true; |
|
768 - |
|
769 - /* |
|
770 - * Use __gnuc_va_list in arg types in place of va_list. |
|
771 - * On 386BSD use __gnuc_va_list instead of _VA_LIST_. On Tru64 UNIX V5.1A |
|
772 - * use __gnuc_va_list instead of __VA_LIST__. We're hoping the |
|
773 - * trailing parentheses and semicolon save all other systems from this. |
|
774 - * Define __not_va_list__ (something harmless and unused) |
|
775 - * instead of va_list. |
|
776 - * Don't claim to have defined va_list. |
|
777 - */ |
|
778 - sed = "s@[ \t]va_list\\([ \t)]\\)@ __gnuc_va_list\\1@\n" |
|
779 - "s@(va_list)&@(__gnuc_va_list)\\&@\n" |
|
780 - "s@ _VA_LIST_));@ __gnuc_va_list));@\n" |
|
781 - "s@ __VA_LIST__));@ __gnuc_va_list));@\n" |
|
782 - "s@ va_list@ __not_va_list__@\n" |
|
783 - "s@\\*va_list@*__not_va_list__@\n" |
|
784 - "s@ __va_list)@ __gnuc_va_list)@\n" |
|
785 - "s@typedef[ \t]\\(.*\\)[ \t]va_list[ \t]*;" |
|
786 - "@typedef \\1 __not_va_list__;@\n" |
|
787 - "s@typedef[ \t]*__va_list__@typedef __gnuc_va_list@\n" |
|
788 - "s@GNUC_VA_LIST@GNUC_Va_LIST@\n" |
|
789 - "s@_VA_LIST_DEFINED@_Va_LIST_DEFINED@\n" |
|
790 - "s@_NEED___VA_LIST@_NEED___Va_LIST@\n" |
|
791 - "s@VA_LIST@DUMMY_VA_LIST@\n" |
|
792 - "s@_Va_LIST@_VA_LIST@"; |
|
793 - test_text = "extern void mumble( va_list);"; |
|
794 -}; |
|
795 - |
|
796 - |
|
797 -/* |
|
798 * Fix headers that use va_list from stdio.h to use the updated |
|
799 * va_list from the stdio_va_list change. Note _BSD_VA_LIST_ is |
|
800 * dealt with elsewhere. The presence of __gnuc_va_list, |
|
801 @@ -4172,35 +3406,6 @@ |
|
802 }; |
|
803 |
|
804 |
|
805 -/* |
|
806 - * Some SysV r4 systems, including Sequent's DYNIX/ptx, use the local |
|
807 - * function 'getrnge' in <regexp.h> before they declare it. For these |
|
808 - * systems add a 'static int' declaration of 'getrnge' into <regexp.h> |
|
809 - * early on. |
|
810 - * |
|
811 - * 'getrnge' traditionally manipulates a file-scope global called 'size', |
|
812 - * so put the declaration right after the declaration of 'size'. |
|
813 - * |
|
814 - * Don't do this if there is already a `static void getrnge' declaration |
|
815 - * present, since this would cause a redeclaration error. Solaris 2.x has |
|
816 - * such a declaration. |
|
817 - */ |
|
818 -fix = { |
|
819 - hackname = svr4_undeclared_getrnge; |
|
820 - files = regexp.h; |
|
821 - select = "getrnge"; |
|
822 - bypass = "static void getrnge"; |
|
823 - c_fix = format; |
|
824 - c_fix_arg = "%0\n" |
|
825 - "static int getrnge ();"; |
|
826 - c_fix_arg = "^static int[ \t]+size;"; |
|
827 - test_text = "static int size;\n" |
|
828 - "/* stuff which calls getrnge() */\n" |
|
829 - "static getrnge()\n" |
|
830 - "{}"; |
|
831 -}; |
|
832 - |
|
833 - |
|
834 /* |
|
835 * Fix return value of mem{ccpy,chr,cpy,set} and str{len,spn,cspn} |
|
836 * in string.h on sysV68 |
|