comparison fixincludes/inclhack.def @ 67:f6334be47118

update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
author nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
date Tue, 22 Mar 2011 17:18:12 +0900
parents b7f97abdc517
children 04ced10e8804
comparison
equal deleted inserted replaced
65:65488c3d617d 67:f6334be47118
1983 * Fix hpux broken #ifndef _XOPEN_SOURCE_EXTENDED conditional on htonl etc. 1983 * Fix hpux broken #ifndef _XOPEN_SOURCE_EXTENDED conditional on htonl etc.
1984 */ 1984 */
1985 fix = { 1985 fix = {
1986 hackname = hpux_htonl; 1986 hackname = hpux_htonl;
1987 files = netinet/in.h; 1987 files = netinet/in.h;
1988 select = "#ifndef _XOPEN_SOURCE_EXTENDED\n" 1988 select = "#ifndef _XOPEN_SOURCE_EXTENDED[ \t]*\n"
1989 "(/\\*\n" 1989 "(/\\*\n"
1990 " \\* Macros for number representation conversion\\.\n" 1990 " \\* Macros for number representation conversion\\.\n"
1991 " \\*/\n" 1991 " \\*/\n"
1992 "#ifndef ntohl)"; 1992 "#ifndef ntohl)";
1993 c_fix = format; 1993 c_fix = format;
2478 files = fixinc-test-limits.h, limits.h; 2478 files = fixinc-test-limits.h, limits.h;
2479 select = "^extern const "; 2479 select = "^extern const ";
2480 c_fix = format; 2480 c_fix = format;
2481 c_fix_arg = "extern __const "; 2481 c_fix_arg = "extern __const ";
2482 test_text = "extern const char limit; /* test limits */"; 2482 test_text = "extern const char limit; /* test limits */";
2483 };
2484
2485
2486 /*
2487 * IRIX 6.5 PTHREAD_*_INITIALIZER need an additional level of braces in
2488 * <pthread.h>.
2489 */
2490 fix = {
2491 hackname = irix_pthread_init;
2492 files = pthread.h;
2493 select = "^(#define[ \t]+PTHREAD_.*_INITIALIZER[ \t]+)(\\{ 0 \\})";
2494
2495 mach = "mips-sgi-irix6.5";
2496 c_fix = format;
2497 c_fix_arg = "%1{ %2 }";
2498 test_text = "#define PTHREAD_MUTEX_INITIALIZER { 0 }\n"
2499 "#define PTHREAD_COND_INITIALIZER { 0 }\n"
2500 "#define PTHREAD_RWLOCK_INITIALIZER { 0 }";
2483 }; 2501 };
2484 2502
2485 2503
2486 /* 2504 /*
2487 * IRIX 6.5.1[78] <sys/socket.h> has a broken definition of socklen_t. 2505 * IRIX 6.5.1[78] <sys/socket.h> has a broken definition of socklen_t.
3247 test_text = 'extern int rename(const char *old, const char *new);'; 3265 test_text = 'extern int rename(const char *old, const char *new);';
3248 }; 3266 };
3249 3267
3250 3268
3251 /* 3269 /*
3270 * Solaris 10+ <sys/feature_tests.h> defines _RESTRICT_KYWD as restrict
3271 * for C99. This is wrong for C++, which needs many C99 features, but
3272 * only supports __restrict.
3273 */
3274 fix = {
3275 hackname = solaris___restrict;
3276 files = sys/feature_tests.h;
3277 select = "#define[ \t]*_RESTRICT_KYWD[ \t]*restrict";
3278 mach = "*-*-solaris2*";
3279 c_fix = format;
3280 c_fix_arg = "#ifdef __cplusplus\n#define\t_RESTRICT_KYWD\t__restrict\n"
3281 "#else\n%0\n#endif";
3282 test_text = "#define _RESTRICT_KYWD restrict";
3283 };
3284
3285
3286 /*
3252 * Solaris 10+ complex.h defines _Complex_I and _Imaginary_I in terms of 3287 * Solaris 10+ complex.h defines _Complex_I and _Imaginary_I in terms of
3253 * themselves, which are Sun Studio compiler intrinsics. Remove _Imaginary_I 3288 * themselves, which are Sun Studio compiler intrinsics. Remove _Imaginary_I
3254 * and imaginary definitions which are not supported by GCC. 3289 * and imaginary definitions which are not supported by GCC.
3255 */ 3290 */
3256 fix = { 3291 fix = {
3267 "#define complex _Complex\n" 3302 "#define complex _Complex\n"
3268 "#define _Imaginary_I _Imaginary_I\n" 3303 "#define _Imaginary_I _Imaginary_I\n"
3269 "#define imaginary _Imaginary\n" 3304 "#define imaginary _Imaginary\n"
3270 "#undef I\n" 3305 "#undef I\n"
3271 "#define I _Imaginary_I"; 3306 "#define I _Imaginary_I";
3307 };
3308
3309
3310 /*
3311 * Solaris 10+ <complex.h> is wrapped in #ifndef __cplusplus. Wrap in
3312 * extern "C" instead so libstdc++ can use it.
3313 */
3314 fix = {
3315 hackname = solaris_complex_cxx;
3316 mach = "*-*-solaris2.*";
3317 files = complex.h;
3318 sed = "/#if[ \t]*!defined(__cplusplus)/c"
3319 "#ifdef\t__cplusplus\\\nextern \"C\" {\\\n#endif";
3320 sed = "/#endif[ \t]*\\/\\* !defined(__cplusplus) \\*\\//c"
3321 "#ifdef\t__cplusplus\\\n}\\\n#endif";
3322 test_text = "#if !defined(__cplusplus)\n"
3323 "#endif /* !defined(__cplusplus) */";
3324 };
3325
3326
3327 /*
3328 * Solaris 8 PTHREAD_COND_INITIALIZER lacks the __pthread_cond_magic field.
3329 * COND_MAGIC is only defined in <synch.h> and pollutes the namespace, so
3330 * use the value literally instead.
3331 */
3332 fix = {
3333 hackname = solaris_cond_init;
3334 select = '@\(#\)pthread.h' "[ \t]+1.[0-9]+[ \t]+[0-9/]+ SMI";
3335 files = pthread.h;
3336 mach = '*-*-solaris2.8';
3337 c_fix = format;
3338 c_fix_arg = "%1, 0x4356%2";
3339 c_fix_arg = "^(#define[ \t]+PTHREAD_COND_INITIALIZER[ \t]+"
3340 "\\{.*0)(\\},[ \t]*0\\}.*)$";
3341 test_text =
3342 '#pragma ident "@(#)pthread.h 1.29 01/07/07 SMI"'"\n"
3343 '#define PTHREAD_COND_INITIALIZER {{{0}, 0}, 0} /* = DEFAULTCV */';
3272 }; 3344 };
3273 3345
3274 3346
3275 /* 3347 /*
3276 * Sun Solaris 10 defines several C99 math macros in terms of 3348 * Sun Solaris 10 defines several C99 math macros in terms of
3638 test_text = "#if\tdefined(__cplusplus) && (__cplusplus < 54321L)"; 3710 test_text = "#if\tdefined(__cplusplus) && (__cplusplus < 54321L)";
3639 }; 3711 };
3640 3712
3641 3713
3642 /* 3714 /*
3715 * On Solaris 8 and 9, __va_list needs to become a typedef for
3716 * __builtin_va_list to make -Wmissing-format-attribute work.
3717 */
3718 fix = {
3719 hackname = solaris_sys_va_list;
3720 files = sys/va_list.h;
3721 mach = '*-*-solaris2.[89]';
3722 select = "#if.*__STDC__.*\n"
3723 "typedef void \\*__va_list;\n"
3724 "#else\n"
3725 "typedef char \\*__va_list;\n"
3726 "#endif";
3727
3728 c_fix = format;
3729 c_fix_arg = "#ifdef __GNUC__\n"
3730 "typedef __builtin_va_list __va_list;\n"
3731 "#else\n"
3732 "%0\n"
3733 "#endif";
3734 test_text = "#if defined(__STDC__) && !defined(__ia64)\n"
3735 "typedef void *__va_list;\n"
3736 "#else\n"
3737 "typedef char *__va_list;\n"
3738 "#endif";
3739 };
3740
3741
3742 /*
3643 * a missing semi-colon at the end of the statsswtch structure definition. 3743 * a missing semi-colon at the end of the statsswtch structure definition.
3644 */ 3744 */
3645 fix = { 3745 fix = {
3646 hackname = statsswtch; 3746 hackname = statsswtch;
3647 files = rpcsvc/rstat.h; 3747 files = rpcsvc/rstat.h;