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
This commit is contained in:
Rainer Orth 2002-04-29 19:42:41 +00:00 committed by Rainer Orth
parent 1034407f00
commit d8af08680b
4 changed files with 93 additions and 3 deletions

View 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

View 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.
*
@ -3726,6 +3726,51 @@ static const char* apzSolaris_Stdio_TagPatch[] = { "sed",
"-e", "s/defined(__cplusplus) && (__cplusplus < 54321L)/0/",
(char*)NULL };
/* * * * * * * * * * * * * * * * * * * * * * * * * *
*
* 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
@ -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,

View File

@ -2092,6 +2092,23 @@ fix = {
test_text = '#if\tdefined(__cplusplus) && (__cplusplus < 54321L)';
};
/*
* <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.
*/

View File

@ -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 */