diff options
author | Vladimir Makarov <vmakarov@redhat.com> | 2008-03-29 15:22:56 +0000 |
---|---|---|
committer | Vladimir Makarov <vmakarov@redhat.com> | 2008-03-29 15:22:56 +0000 |
commit | 4dda1ba90237963ca8bd56fa81cc85eaadb36751 (patch) | |
tree | 425b5e1a7689e66cacfafeb7600a109c77579170 /fixincludes | |
parent | f67cdafe0b18985ff7bd276d83a2bb641468cb50 (diff) |
Merged with thrunk at 133688
git-svn-id: https://gcc.gnu.org/svn/gcc/branches/ira@133716 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'fixincludes')
-rw-r--r-- | fixincludes/ChangeLog | 19 | ||||
-rw-r--r-- | fixincludes/fixincl.c | 3 | ||||
-rw-r--r-- | fixincludes/fixincl.x | 119 | ||||
-rw-r--r-- | fixincludes/inclhack.def | 65 | ||||
-rw-r--r-- | fixincludes/tests/base/iso/math_c99.h | 7 | ||||
-rw-r--r-- | fixincludes/tests/base/stdio.h | 5 |
6 files changed, 210 insertions, 8 deletions
diff --git a/fixincludes/ChangeLog b/fixincludes/ChangeLog index 7a8c78a99cd..49afc5ece9b 100644 --- a/fixincludes/ChangeLog +++ b/fixincludes/ChangeLog @@ -1,3 +1,22 @@ +2008-03-07 Peter O'Gorman <pogma@thewrittenword.com> + + PR c++/20366 + * inclhack.def (AAB_aix_stdio): Hack stdio.h for -D_LARGE_FILES. + * fixincl.x: Regenerate. + * tests/base/stdio.h: Add test. + +2008-02-25 Ben Elliston <bje@au.ibm.com> + + PR other/32948 + * fixincl.c (fix_applies): Remove unused variable `name_len'. + +2008-02-19 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> + + * inclhack.def (solaris_math_10): New. + * tests/base/iso/math_c99.h: Update. + + * fixincl.x: Regenerate. + 2008-02-04 Ismail Dönmez <ismail@pardus.org.tr> * inclhack.def: (bsd_stdio_attrs_conflict, freebsd_gcc3_breakage, diff --git a/fixincludes/fixincl.c b/fixincludes/fixincl.c index ccb2badc54f..a6a8abef027 100644 --- a/fixincludes/fixincl.c +++ b/fixincludes/fixincl.c @@ -1046,11 +1046,8 @@ fix_applies (tFixDesc* p_fixd) if (pz_scan != (char *) NULL) { - size_t name_len; - while ((pz_fname[0] == '.') && (pz_fname[1] == '/')) pz_fname += 2; - name_len = strlen (pz_fname); for (;;) { diff --git a/fixincludes/fixincl.x b/fixincludes/fixincl.x index f6602004e62..4338150135c 100644 --- a/fixincludes/fixincl.x +++ b/fixincludes/fixincl.x @@ -2,11 +2,11 @@ * * DO NOT EDIT THIS FILE (fixincl.x) * - * It has been AutoGen-ed Monday February 4, 2008 at 09:22:58 PM GMTST + * It has been AutoGen-ed Friday March 7, 2008 at 07:37:21 AM CET * From the definitions inclhack.def * and the template file fixincl */ -/* DO NOT SVN-MERGE THIS FILE, EITHER Mon Feb 4 21:22:58 GMTST 2008 +/* DO NOT SVN-MERGE THIS FILE, EITHER Fr 7. Mär 07:37:22 CET 2008 * * You must regenerate it. Use the ./genfixes script. * @@ -15,7 +15,7 @@ * certain ANSI-incompatible system header files which are fixed to work * correctly with ANSI C and placed in a directory that GNU C will search. * - * This file contains 211 fixup descriptions. + * This file contains 213 fixup descriptions. * * See README for more information. * @@ -38,6 +38,64 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * + * Description of Aab_Aix_Stdio fix + */ +tSCC zAab_Aix_StdioName[] = + "AAB_aix_stdio"; + +/* + * File name selection pattern + */ +tSCC zAab_Aix_StdioList[] = + "stdio.h\0"; +/* + * Machine/OS name selection pattern + */ +tSCC* apzAab_Aix_StdioMachs[] = { + "*-*-aix*", + (const char*)NULL }; + +/* + * content selection pattern - do fix if pattern found + */ +tSCC zAab_Aix_StdioSelect0[] = + "define fopen fopen64"; + +#define AAB_AIX_STDIO_TEST_CT 1 +static tTestDesc aAab_Aix_StdioTests[] = { + { TT_EGREP, zAab_Aix_StdioSelect0, (regex_t*)NULL }, }; + +/* + * Fix Command Arguments for Aab_Aix_Stdio + */ +static const char* apzAab_Aix_StdioPatch[] = { + "wrap", + "", + "\n\ +#if defined __GNUG__ && defined _LARGE_FILES && defined __cplusplus\n\ +#define __need__aix_stdio_h_fix\n\ +#ifdef __need__aix_stdio_h_fix\n\ +#undef fseeko\n\ +#undef ftello\n\ +#undef fgetpos\n\ +#undef fsetpos\n\ +#undef fopen\n\ +#undef freopen\n\ +/* Alias the symbols using asm */\n\ +extern \"C\" {\n\ +extern int fgetpos(FILE *, fpos64_t *) __asm__(\"fgetpos64\");\n\ +extern FILE *fopen(const char *, const char *) __asm__(\"fopen64\");\n\ +extern FILE *freopen(const char *, const char *, FILE *) __asm__(\"freopen64\");\n\ +extern int fseeko(FILE *, off64_t, int) __asm__(\"fseeko64\");\n\ +extern int fsetpos(FILE *, const fpos64_t *) __asm__(\"fsetpos64\");\n\ +extern off64_t ftello(FILE *) __asm__(\"ftello64\");\n\ +}\n\ +#endif\n\ +#endif\n", + (char*)NULL }; + +/* * * * * * * * * * * * * * * * * * * * * * * * * * + * * Description of Aab_Darwin7_9_Long_Double_Funcs fix */ tSCC zAab_Darwin7_9_Long_Double_FuncsName[] = @@ -5886,6 +5944,45 @@ static const char* apzSolaris_Math_9Patch[] = { /* * * * * * * * * * * * * * * * * * * * * * * * * * * + * Description of Solaris_Math_10 fix + */ +tSCC zSolaris_Math_10Name[] = + "solaris_math_10"; + +/* + * File name selection pattern + */ +tSCC zSolaris_Math_10List[] = + "iso/math_c99.h\0"; +/* + * Machine/OS name selection pattern + */ +#define apzSolaris_Math_10Machs (const char**)NULL + +/* + * content selection pattern - do fix if pattern found + */ +tSCC zSolaris_Math_10Select0[] = + "@\\(#\\)math_c99.h[ \t]+1.[0-9]+[ \t]+[0-9/]+ SMI"; + +#define SOLARIS_MATH_10_TEST_CT 1 +static tTestDesc aSolaris_Math_10Tests[] = { + { TT_EGREP, zSolaris_Math_10Select0, (regex_t*)NULL }, }; + +/* + * Fix Command Arguments for Solaris_Math_10 + */ +static const char* apzSolaris_Math_10Patch[] = { + "format", + "#define\tisinf(x) __builtin_isinf(x)", + "^#define[ \t]+isinf\\(x\\)[ \t]+__extension__\\([ \t]*\\\\\n\ +[ \t]*\\{[ \t]*__typeof\\(x\\)[ \t]*__x_i[ \t]*=[ \t]*\\(x\\);[ \t]*\\\\\n\ +[ \t]*__x_i[ \t]*==[ \t]*\\(__typeof\\(__x_i\\)\\)[ \t]*INFINITY[ \t]*\\|\\|[ \t]*\\\\\n\ +[ \t]*__x_i[ \t]*==[ \t]*\\(__typeof\\(__x_i\\)\\)[ \t]*\\(-INFINITY\\);[ \t]*\\}\\)", + (char*)NULL }; + +/* * * * * * * * * * * * * * * * * * * * * * * * * * + * * Description of Solaris_Mutex_Init_1 fix */ tSCC zSolaris_Mutex_Init_1Name[] = @@ -8567,14 +8664,15 @@ static const char* apzX11_SprintfPatch[] = { * * List of all fixes */ -#define REGEX_COUNT 254 +#define REGEX_COUNT 256 #define MACH_LIST_SIZE_LIMIT 261 -#define FIX_COUNT 211 +#define FIX_COUNT 213 /* * Enumerate the fixes */ typedef enum { + AAB_AIX_STDIO_FIXIDX, AAB_DARWIN7_9_LONG_DOUBLE_FUNCS_FIXIDX, AAB_DARWIN7_9_LONG_DOUBLE_FUNCS_2_FIXIDX, AAB_FD_ZERO_ASM_POSIX_TYPES_H_FIXIDX, @@ -8718,6 +8816,7 @@ typedef enum { SOLARIS_MATH_4_FIXIDX, SOLARIS_MATH_8_FIXIDX, SOLARIS_MATH_9_FIXIDX, + SOLARIS_MATH_10_FIXIDX, SOLARIS_MUTEX_INIT_1_FIXIDX, SOLARIS_MUTEX_INIT_2_FIXIDX, SOLARIS_RWLOCK_INIT_1_FIXIDX, @@ -8789,6 +8888,11 @@ typedef enum { } t_fixinc_idx; tFixDesc fixDescList[ FIX_COUNT ] = { + { zAab_Aix_StdioName, zAab_Aix_StdioList, + apzAab_Aix_StdioMachs, + AAB_AIX_STDIO_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE, + aAab_Aix_StdioTests, apzAab_Aix_StdioPatch, 0 }, + { zAab_Darwin7_9_Long_Double_FuncsName, zAab_Darwin7_9_Long_Double_FuncsList, apzAab_Darwin7_9_Long_Double_FuncsMachs, AAB_DARWIN7_9_LONG_DOUBLE_FUNCS_TEST_CT, FD_MACH_ONLY | FD_REPLACEMENT, @@ -9504,6 +9608,11 @@ tFixDesc fixDescList[ FIX_COUNT ] = { SOLARIS_MATH_9_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE, aSolaris_Math_9Tests, apzSolaris_Math_9Patch, 0 }, + { zSolaris_Math_10Name, zSolaris_Math_10List, + apzSolaris_Math_10Machs, + SOLARIS_MATH_10_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE, + aSolaris_Math_10Tests, apzSolaris_Math_10Patch, 0 }, + { zSolaris_Mutex_Init_1Name, zSolaris_Mutex_Init_1List, apzSolaris_Mutex_Init_1Machs, SOLARIS_MUTEX_INIT_1_TEST_CT, FD_MACH_ONLY, diff --git a/fixincludes/inclhack.def b/fixincludes/inclhack.def index fd8a694a9f7..04b0c82ed6c 100644 --- a/fixincludes/inclhack.def +++ b/fixincludes/inclhack.def @@ -20,6 +20,47 @@ autogen definitions fixincl; FIXINC_DEBUG = yes; #endif +/* On AIX when _LARGE_FILES is defined stdio.h defines fopen to + * fopen64 etc. and this causes problems when building with g++ + * because cstdio udefs everything from stdio.h, leaving us with + * ::fopen has not been declared errors. This fixes stdio.h to + * undef those defines and use __asm__ to alias the symbols if + * building with g++ and -D_LARGE_FILES + */ +fix = { + hackname = AAB_aix_stdio; + files = stdio.h; + select = "define fopen fopen64"; + mach = "*-*-aix*"; + + c_fix = wrap; + + c_fix_arg = ""; + + c_fix_arg = "\n" + "#if defined __GNUG__ && defined _LARGE_FILES && defined __cplusplus\n" + "#define __need__aix_stdio_h_fix\n" + "#ifdef __need__aix_stdio_h_fix\n" + "#undef fseeko\n" + "#undef ftello\n" + "#undef fgetpos\n" + "#undef fsetpos\n" + "#undef fopen\n" + "#undef freopen\n" + "/* Alias the symbols using asm */\n" + "extern \"C\" {\n" + "extern int fgetpos(FILE *, fpos64_t *) __asm__(\"fgetpos64\");\n" + "extern FILE *fopen(const char *, const char *) __asm__(\"fopen64\");\n" + "extern FILE *freopen(const char *, const char *, FILE *) __asm__(\"freopen64\");\n" + "extern int fseeko(FILE *, off64_t, int) __asm__(\"fseeko64\");\n" + "extern int fsetpos(FILE *, const fpos64_t *) __asm__(\"fsetpos64\");\n" + "extern off64_t ftello(FILE *) __asm__(\"ftello64\");\n" + "}\n" + "#endif\n" + "#endif\n"; + test_text = ""; +}; + /* * On Mac OS 10.3.9, the 'long double' functions are available in @@ -3223,6 +3264,30 @@ fix = { }; /* + * On Solaris 11, if you do isinf(NaN) you'll get a floating point + * exception. Provide an alternative using GCC's builtin. + */ + +fix = { + hackname = solaris_math_10; + select = '@\(#\)math_c99.h' "[ \t]+1.[0-9]+[ \t]+[0-9/]+ SMI"; + files = iso/math_c99.h; + c_fix = format; + c_fix_arg = "#define\tisinf(x) __builtin_isinf(x)"; + c_fix_arg = "^#define[ \t]+isinf\\(x\\)[ \t]+__extension__\\([ \t]*\\\\\n" + "[ \t]*\\{[ \t]*__typeof\\(x\\)[ \t]*__x_i[ \t]*=[ \t]*\\(x\\);[ \t]*\\\\\n" + "[ \t]*__x_i[ \t]*==[ \t]*\\(__typeof\\(__x_i\\)\\)[ \t]*INFINITY[ \t]*\\|\\|[ \t]*\\\\\n" + "[ \t]*__x_i[ \t]*==[ \t]*\\(__typeof\\(__x_i\\)\\)[ \t]*\\(-INFINITY\\);[ \t]*\\}\\)"; + test_text = + '#pragma ident "@(#)math_c99.h 1.12 07/01/21 SMI"'"\n" + "#undef isinf\n" + "#define isinf(x) __extension__( \\\\\n" + " { __typeof(x) __x_i = (x); \\\\\n" + " __x_i == (__typeof(__x_i)) INFINITY || \\\\\n" + " __x_i == (__typeof(__x_i)) (-INFINITY); })"; +}; + +/* * Sun Solaris 2.5.1, 2.6 defines PTHREAD_{MUTEX|COND}_INITIALIZER * incorrectly, so we replace them with versions that correspond to * the definition. We also explicitly name this fix "1" and the next diff --git a/fixincludes/tests/base/iso/math_c99.h b/fixincludes/tests/base/iso/math_c99.h index e87ca874276..e3b27994422 100644 --- a/fixincludes/tests/base/iso/math_c99.h +++ b/fixincludes/tests/base/iso/math_c99.h @@ -77,3 +77,10 @@ #undef isunordered #define isunordered(x, y) __builtin_isunordered(x, y) #endif /* SOLARIS_MATH_9_CHECK */ + + +#if defined( SOLARIS_MATH_10_CHECK ) +#pragma ident "@(#)math_c99.h 1.12 07/01/21 SMI" +#undef isinf +#define isinf(x) __builtin_isinf(x) +#endif /* SOLARIS_MATH_10_CHECK */ diff --git a/fixincludes/tests/base/stdio.h b/fixincludes/tests/base/stdio.h index ea2c001e163..b6a8a9b7e1c 100644 --- a/fixincludes/tests/base/stdio.h +++ b/fixincludes/tests/base/stdio.h @@ -14,6 +14,11 @@ #include <stdarg.h> +#if defined( AAB_AIX_STDIO_CHECK ) + +#endif /* AAB_AIX_STDIO_CHECK */ + + #if defined( ALPHA_GETOPT_CHECK ) extern int getopt(int, char *const[], const char *); #endif /* ALPHA_GETOPT_CHECK */ |