This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: 3.1 PATCH: Fix Solaris 2.5.1 <widec.h> to avoid bootstrap failure
- From: Rainer Orth <ro at TechFak dot Uni-Bielefeld dot DE>
- To: Mark Mitchell <mark at codesourcery dot com>
- Cc: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>, Bruce Korb <bkorb at gnu dot org>, "libstdc++ at gcc dot gnu dot org" <libstdc++ at gcc dot gnu dot org>
- Date: Mon, 29 Apr 2002 21:41:45 +0200 (MEST)
- Subject: Re: 3.1 PATCH: Fix Solaris 2.5.1 <widec.h> to avoid bootstrap failure
- References: <15562.2299.470938.584607@xayide.TechFak.Uni-Bielefeld.DE><208030000.1019930149@gandalf.codesourcery.com>
Mark Mitchell writes:
> > +fix = {
> > + hackname = solaris_widec;
> > + files = widec.h;
> > + mach = '*-*-solaris*';
>
> Can we use "*-*-solaris2.[0-5]*" here instead? That would reduce the
> risk of the patch; there is no need for it to apply to later versions.
This came to my mind after submitting the patch, although the bypass on
wchar.h should avoid this. Anyway, better safe than sorry ...
> The patch is OK for the branch with that change.
Thanks. The exact patch applied to branch and trunk (incorporating this
change and Bruce's comments) is included below.
Rainer
Index: fixinc/inclhack.def
===================================================================
RCS file: /cvs/gcc/gcc/gcc/fixinc/inclhack.def,v
retrieving revision 1.120.2.5
diff -u -p -r1.120.2.5 inclhack.def
--- fixinc/inclhack.def 2 Apr 2002 18:23:17 -0000 1.120.2.5
+++ fixinc/inclhack.def 29 Apr 2002 19:25:58 -0000
@@ -2093,6 +2093,23 @@ fix = {
};
/*
+ * <widec.h> until Solaris 2.5.1 defines macros for a couple of <wchar.h>
+ * functions, breaking their prototypes if that file is included afterwards.
+ * Include <wchar.h> early to avoid this issue, as is done on Solaris 2.6
+ * and up.
+ */
+fix = {
+ hackname = solaris_widec;
+ files = widec.h;
+ mach = '*-*-solaris2.[0-5]*';
+ bypass = "include.*wchar\\.h";
+ select = "#include <euc.h>";
+ c_fix = format;
+ c_fix_arg = "%0\n#include <wchar.h>";
+ test_text = "#include <euc.h>";
+};
+
+/*
* Sony NEWSOS 5.0 does not support the complete ANSI C standard.
*/
#ifdef SONY
Index: fixinc/tests/base/widec.h
===================================================================
RCS file: fixinc/tests/base/widec.h
diff -N fixinc/tests/base/widec.h
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ fixinc/tests/base/widec.h 29 Apr 2002 19:25:58 -0000
@@ -0,0 +1,15 @@
+/* DO NOT EDIT THIS FILE.
+
+ It has been auto-edited by fixincludes from:
+
+ "fixinc/tests/inc/widec.h"
+
+ This had to be done to correct non-standard usages in the
+ original, manufacturer supplied header file. */
+
+
+
+#if defined( SOLARIS_WIDEC_CHECK )
+#include <euc.h>
+#include <wchar.h>
+#endif /* SOLARIS_WIDEC_CHECK */