This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Patch to add some test_text to inclhack.def


This patch adds some test_text to various fixes triggered on SunOS4.

It also fixes a couple of tests.  The bogus_ifdef fixes operated on
underscore surrounded macros, but we stopped wrapping most of them
except for the ones that were relevant to the platform in question.
So on sunos4 the original unwrapped copies are now left in.  I changed
the tests to accept and fix either style.

Tested by running fixinc's "make check" on sparc-sun-solaris2.7 and
verifying the diffs.  Okay to install?

		--Kaveh



2000-05-18  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>

	* check.tpl: Make directories `hsfs' and `pixrect'.

	* inclhack.def (sun_bogus_ifdef, sun_bogus_ifdef_sun4c): Update to
	handle macros both with and without surrounding underscores.
	(sun_malloc): Add `calloc' fix.
	(sun_auth_proto, sun_bogus_ifdef, sun_bogus_ifdef_sun4c,
	sun_catmacro, sun_malloc, sun_signal, sunos_matherr_decl,
	sunos_strlen, sysz_stdlib_for_sun, sysz_stdtypes_for_sun): Add
	test_text.

diff -rup orig/egcs-CVS20000517/gcc/fixinc/check.tpl egcs-CVS20000517/gcc/fixinc/check.tpl
--- orig/egcs-CVS20000517/gcc/fixinc/check.tpl	Tue May 16 10:54:22 2000
+++ egcs-CVS20000517/gcc/fixinc/check.tpl	Thu May 18 11:44:34 2000
@@ -21,7 +21,7 @@ export TARGET_MACHINE DESTDIR SRCDIR FIN
 mkdir ${DESTDIR} ${SRCDIR}
 
 ( cd ${SRCDIR}
-  mkdir netinet rpc sparc sundev sunwindow sys X11 Xm )
+  mkdir netinet rpc sparc sundev sunwindow sys X11 Xm hsfs pixrect)
 
 [=
 
diff -rup orig/egcs-CVS20000517/gcc/fixinc/inclhack.def egcs-CVS20000517/gcc/fixinc/inclhack.def
--- orig/egcs-CVS20000517/gcc/fixinc/inclhack.def	Wed May 17 11:00:23 2000
+++ egcs-CVS20000517/gcc/fixinc/inclhack.def	Thu May 18 12:19:25 2000
@@ -1855,6 +1859,13 @@ fix = {
                     '\1\2' "\\\n"
                     "#endif"
                 "/";
+    test_text = "struct auth_ops {\n"
+                "void (*ah_nextverf)();\n"
+                "int  (*ah_marshal)();        /* nextverf & serialize */\n"
+                "int  (*ah_validate)();       /* validate varifier */\n"
+                "int  (*ah_refresh)();        /* refresh credentials */\n"
+                "void (*ah_destroy)();        /* destroy this structure */\n"
+                "} *ah_ops;";
 };
 
 
@@ -1865,8 +1876,12 @@ fix = {
     hackname = sun_bogus_ifdef;
     files  = "hsfs/hsfs_spec.h";
     files  = "hsfs/iso_spec.h";
-    select = '#ifdef __i386__ || __vax__';
-    sed    = "s/\\#ifdef __i386__ || __vax__/\\#if __i386__ || __vax__/g";
+    select = '#ifdef (i386|__i386__) || (vax|__vax__)';
+    sed    = "s/\\#ifdef \\([_]*i386[_]* || [_]*vax[_]*\\)/\\#if \\1/g";
+    test_text = "#ifdef i386 || vax\n"
+                "#endif\n"
+                "#ifdef __i386__ || __vax__\n"
+                "#endif\n";
 };
 
 
@@ -1876,8 +1891,12 @@ fix = {
 fix = {
     hackname = sun_bogus_ifdef_sun4c;
     files  = "hsfs/hsnode.h";
-    select = '#ifdef __i386__ || __sun4c__';
-    sed    = "s/\\#ifdef __i386__ || __sun4c__/\\#if __i386__ || __sun4c__/g";
+    select = '#ifdef (i386|__i386__) || (sun4c|__sun4c__)';
+    sed    = "s/\\#ifdef \\([_]*i386[_]* || [_]*sun4c[_]*\\)/\\#if \\1/g";
+    test_text = "#ifdef i386 || sun4c\n"
+                "#endif\n"
+                "#ifdef __i386__ || __sun4c__\n"
+                "#endif\n";
 };
 
 
@@ -1895,6 +1914,11 @@ fix = {
 
     sed    = "/^#define[ \t]CAT(a,b)/ a\\\n"
                  "#endif\n";
+    test_text = "#ifndef CAT\n"
+                "#undef  IDENT\n"
+                "#define IDENT(x)        x\n"
+                "#define CAT(a,b)        IDENT(a)b\n"
+                "#endif\n";
 };
 
 
@@ -1910,6 +1934,15 @@ fix = {
     sed   = "s/int[ \t][ \t]*free/void\tfree/g";
     sed   = "s/char\\([ \t]*\\*[ \t]*malloc\\)/void\\1/g";
     sed   = "s/char\\([ \t]*\\*[ \t]*realloc\\)/void\\1/g";
+    sed   = "s/char\\([ \t]*\\*[ \t]*calloc\\)/void\\1/g";
+    test_text = "typedef char *  malloc_t;\n"
+                "extern  void    free ();\n"
+                "extern  malloc_t        calloc ();\n"
+                "extern  malloc_t        malloc ();\n"
+                "extern  malloc_t        realloc ();\n"
+                "extern  char *        calloc ();\n"
+                "extern  char *        malloc ();\n"
+                "extern  char *        realloc ();\n";
 };
 
 
@@ -1941,6 +1974,7 @@ fix = {
 
     sed = "/^void\t" '(\*signal())();$/a'  "\\\n"
           '#endif'                         "\n";
+    test_text = "void	(*signal())();\n";
 };
 
 
@@ -1959,6 +1993,7 @@ fix = {
      */
     sed = "/^struct exception/,$b";
     sed = "/matherr/i\\\nstruct exception;\n";
+    test_text = "extern int	matherr();\n";
 };
 
 
@@ -1970,6 +2005,7 @@ fix = {
     files    = strings.h;
     select   = "int[ \t]*strlen";
     sed = "s/int[ \t]*strlen();/__SIZE_TYPE__ strlen();/";
+    test_text = "int strlen();\n";
 };
 
 
@@ -2418,6 +2454,11 @@ fix = {
     sed   = "s/char[ \t]*\\*[ \t]*realloc/void \\*\trealloc/g";
     sed   = "s/char[ \t]*\\*[ \t]*bsearch/void \\*\tbsearch/g";
     sed   = "s/int[ \t][ \t]*exit/void\texit/g";
+    test_text = "extern char *   calloc();\n"
+                "extern char *   malloc();\n"
+                "extern char *   realloc();\n"
+                "extern char *   bsearch();\n"
+                "extern int      exit();\n";
 };
 
 
@@ -2448,6 +2489,9 @@ fix = {
 
     sed   = "/[\t ]wchar_t.*;/a\\\n"
               "#endif\n";
+    test_text = "typedef int size_t; /* ??? */\n"
+ "typedef int ptrdiff_t; /* result of subtracting two pointers */\n"
+ "typedef unsigned short wchar_t; /* big enough for biggest char set */\n";
 };
 
 

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]