diff options
author | rwild <rwild@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-03-07 06:53:59 +0000 |
---|---|---|
committer | rwild <rwild@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-03-07 06:53:59 +0000 |
commit | 3d906fac73068cc16fe89658b003f61d1c619e15 (patch) | |
tree | 072652d60f8a677c86c43e463b9022934574a6d7 /fixincludes | |
parent | eace38bc109fe9f2e39d9877096542c2c15d2034 (diff) | |
download | gcc-3d906fac73068cc16fe89658b003f61d1c619e15.tar.gz |
fixincludes/
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.
gcc/testsuite/
2008-03-07 Peter O'Gorman <pogma@thewrittenword.com>
PR c++/20366
* g++.dg/other/pr20366.C: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@133001 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'fixincludes')
-rw-r--r-- | fixincludes/ChangeLog | 7 | ||||
-rw-r--r-- | fixincludes/fixincl.x | 95 | ||||
-rw-r--r-- | fixincludes/inclhack.def | 41 | ||||
-rw-r--r-- | fixincludes/tests/base/stdio.h | 5 |
4 files changed, 130 insertions, 18 deletions
diff --git a/fixincludes/ChangeLog b/fixincludes/ChangeLog index c45d8a83d64..49afc5ece9b 100644 --- a/fixincludes/ChangeLog +++ b/fixincludes/ChangeLog @@ -1,3 +1,10 @@ +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 diff --git a/fixincludes/fixincl.x b/fixincludes/fixincl.x index 9da75308834..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 Wednesday February 20, 2008 at 05:10:00 AM CET + * 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 Wed Feb 20 05:10:00 CET 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,31 +15,84 @@ * 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 212 fixup descriptions. + * This file contains 213 fixup descriptions. * * See README for more information. * * inclhack copyright (c) 1998, 1999, 2000, 2001 * The Free Software Foundation, Inc. * - * inclhack is free software. + * inclhack is free software: you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * You may redistribute it and/or modify it under the terms of the - * GNU General Public License, as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * inclhack is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of + * inclhack is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with inclhack. If not, write to: - * The Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor - * Boston, MA 02110-1301, USA. + * You should have received a copy of the GNU General Public License along + * with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +/* * * * * * * * * * * * * * * * * * * * * * * * * * + * + * 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 }; /* * * * * * * * * * * * * * * * * * * * * * * * * * * @@ -8611,14 +8664,15 @@ static const char* apzX11_SprintfPatch[] = { * * List of all fixes */ -#define REGEX_COUNT 255 +#define REGEX_COUNT 256 #define MACH_LIST_SIZE_LIMIT 261 -#define FIX_COUNT 212 +#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, @@ -8834,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, diff --git a/fixincludes/inclhack.def b/fixincludes/inclhack.def index e7447d497ae..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 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 */ |