OSDN Git Service

* fixinc/inclhack.def (solaris_widec): Include <wchar.h> in
authorro <ro@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 29 Apr 2002 19:42:41 +0000 (19:42 +0000)
committerro <ro@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 29 Apr 2002 19:42:41 +0000 (19:42 +0000)
Solaris 2 <widec.h> if missing.
* fixinc/fixincl.x: Regenerate.
* fixinc/tests/base/widec.h: New file.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@52906 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/fixinc/fixincl.x
gcc/fixinc/inclhack.def
gcc/fixinc/tests/base/widec.h [new file with mode: 0644]

index 621d61b..fbfdb69 100644 (file)
@@ -1,3 +1,10 @@
+2002-04-29  Rainer Orth  <ro@TechFak.Uni-Bielefeld.DE>
+
+       * fixinc/inclhack.def (solaris_widec): Include <wchar.h> in
+       Solaris 2 <widec.h> if missing.
+       * fixinc/fixincl.x: Regenerate.
+       * fixinc/tests/base/widec.h: New file.
+
 2002-04-29  Nick Clifton  <nickc@cambridge.redhat.com>
 
        * toplev.c (f_options): Add "profile" switch so that
index 8dd8629..68de2fd 100644 (file)
@@ -5,7 +5,7 @@
  * files which are fixed to work correctly with ANSI C and placed in a
  * directory that GNU C will search.
  *
- * This file contains 141 fixup descriptions.
+ * This file contains 142 fixup descriptions.
  *
  * See README for more information.
  *
@@ -3728,6 +3728,51 @@ static const char* apzSolaris_Stdio_TagPatch[] = { "sed",
 
 /* * * * * * * * * * * * * * * * * * * * * * * * * *
  *
+ *  Description of Solaris_Widec fix
+ */
+tSCC zSolaris_WidecName[] =
+     "solaris_widec";
+
+/*
+ *  File name selection pattern
+ */
+tSCC zSolaris_WidecList[] =
+  "|widec.h|";
+/*
+ *  Machine/OS name selection pattern
+ */
+tSCC* apzSolaris_WidecMachs[] = {
+        "*-*-solaris2.[0-5]*",
+        (const char*)NULL };
+
+/*
+ *  content selection pattern - do fix if pattern found
+ */
+tSCC zSolaris_WidecSelect0[] =
+       "#include <euc.h>";
+
+/*
+ *  content bypass pattern - skip fix if pattern found
+ */
+tSCC zSolaris_WidecBypass0[] =
+       "include.*wchar\\.h";
+
+#define    SOLARIS_WIDEC_TEST_CT  2
+static tTestDesc aSolaris_WidecTests[] = {
+  { TT_NEGREP,   zSolaris_WidecBypass0, (regex_t*)NULL },
+  { TT_EGREP,    zSolaris_WidecSelect0, (regex_t*)NULL }, };
+
+/*
+ *  Fix Command Arguments for Solaris_Widec
+ */
+static const char* apzSolaris_WidecPatch[] = {
+    "format",
+    "%0\n\
+#include <wchar.h>",
+    (char*)NULL };
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * *
+ *
  *  Description of Statsswtch fix
  */
 tSCC zStatsswtchName[] =
@@ -5536,9 +5581,9 @@ static const char* apzX11_SprintfPatch[] = {
  *
  *  List of all fixes
  */
-#define REGEX_COUNT          149
+#define REGEX_COUNT          151
 #define MACH_LIST_SIZE_LIMIT 279
-#define FIX_COUNT            141
+#define FIX_COUNT            142
 
 /*
  *  Enumerate the fixes
@@ -5638,6 +5683,7 @@ typedef enum {
     SCO_UTIME_FIXIDX,
     SOLARIS_MUTEX_INIT_FIXIDX,
     SOLARIS_STDIO_TAG_FIXIDX,
+    SOLARIS_WIDEC_FIXIDX,
     STATSSWTCH_FIXIDX,
     STDIO_STDARG_H_FIXIDX,
     STDIO_VA_LIST_FIXIDX,
@@ -6158,6 +6204,11 @@ tFixDesc fixDescList[ FIX_COUNT ] = {
      SOLARIS_STDIO_TAG_TEST_CT, FD_MACH_ONLY,
      aSolaris_Stdio_TagTests,   apzSolaris_Stdio_TagPatch, 0 },
 
+  {  zSolaris_WidecName,    zSolaris_WidecList,
+     apzSolaris_WidecMachs,
+     SOLARIS_WIDEC_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
+     aSolaris_WidecTests,   apzSolaris_WidecPatch, 0 },
+
   {  zStatsswtchName,    zStatsswtchList,
      apzStatsswtchMachs,
      STATSSWTCH_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
index 1e82ee8..0f1a210 100644 (file)
@@ -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
diff --git a/gcc/fixinc/tests/base/widec.h b/gcc/fixinc/tests/base/widec.h
new file mode 100644 (file)
index 0000000..e3c17ff
--- /dev/null
@@ -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 */