diff options
author | Rainer Orth <ro@TechFak.Uni-Bielefeld.DE> | 2002-04-29 19:42:41 +0000 |
---|---|---|
committer | Rainer Orth <ro@gcc.gnu.org> | 2002-04-29 19:42:41 +0000 |
commit | d8af08680b5c69ec7f69c9613a2f5a226e6029a3 (patch) | |
tree | a0171fd3bf46fb811d26490047c1105c0423c109 /gcc/fixinc | |
parent | 1034407f00b9aefde939c3273dce2dc3574a4857 (diff) | |
download | gcc-d8af08680b5c69ec7f69c9613a2f5a226e6029a3.zip gcc-d8af08680b5c69ec7f69c9613a2f5a226e6029a3.tar.gz gcc-d8af08680b5c69ec7f69c9613a2f5a226e6029a3.tar.bz2 |
inclhack.def (solaris_widec): Include <wchar.h> in Solaris 2 <widec.h> if missing.
* 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.
From-SVN: r52906
Diffstat (limited to 'gcc/fixinc')
-rw-r--r-- | gcc/fixinc/fixincl.x | 57 | ||||
-rw-r--r-- | gcc/fixinc/inclhack.def | 17 | ||||
-rw-r--r-- | gcc/fixinc/tests/base/widec.h | 15 |
3 files changed, 86 insertions, 3 deletions
diff --git a/gcc/fixinc/fixincl.x b/gcc/fixinc/fixincl.x index 8dd8629..68de2fd 100644 --- a/gcc/fixinc/fixincl.x +++ b/gcc/fixinc/fixincl.x @@ -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, diff --git a/gcc/fixinc/inclhack.def b/gcc/fixinc/inclhack.def index 1e82ee8..0f1a210 100644 --- a/gcc/fixinc/inclhack.def +++ b/gcc/fixinc/inclhack.def @@ -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 index 0000000..e3c17ff --- /dev/null +++ b/gcc/fixinc/tests/base/widec.h @@ -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 */ |