[fixincludes] work around non-GNU sed

Gerald Pfeifer gerald@pfeifer.com
Fri Jan 9 19:35:00 GMT 2009


I am not proud of this patch, but -- it works, and gets us rid of
a bogus test failure on FreeBSD since it only revolves around the 
replacement text we inject, not the actual fixing.

Tested on i386-unknown-freebsd6.4.

And for the record, multi-line sed expressions like this _do_ make
my head hurt, too. ;-)

Gerald


2009-01-09  Gerald Pfeifer  <gerald@pfeifer.com>

        * inclhack.def (x11_new): Avoid leading tab in replacement.
        * fixincl.x: Regenerate.
        * tests/base/Xm/Traversal.h: Regenerate.

Index: fixincludes/inclhack.def
===================================================================
--- fixincludes/inclhack.def	(revision 143193)
+++ fixincludes/inclhack.def	(working copy)
@@ -3881,7 +3881,7 @@
 
     sed      = "/Widget\told, new;/i\\\n"
                    "#ifdef __cplusplus\\\n"
-                   "\tWidget\told, c_new;\\\n"
+                   "Widget\told, c_new;\\\n"
                    "#else\n";
 
     sed      = "/Widget\told, new;/a\\\n"
@@ -3890,7 +3890,7 @@
     sed      = "s/Widget new,/Widget c_new,/g";
     test_text =
     "struct wedge {\n"
-    "   Widget\told, new; /* fixinc check FAILS ON BSD */\n"
+    "   Widget\told, new;\n"
     "};\nextern Wedged( Widget new, Widget old );";
 };
 
Index: fixincludes/fixincl.x
===================================================================
--- fixincludes/fixincl.x	(revision 143193)
+++ fixincludes/fixincl.x	(working copy)
@@ -7224,7 +7224,7 @@
 static const char* apzX11_NewPatch[] = { sed_cmd_z,
     "-e", "/Widget\told, new;/i\\\n\
 #ifdef __cplusplus\\\n\
-\tWidget\told, c_new;\\\n\
+Widget\told, c_new;\\\n\
 #else\n",
     "-e", "/Widget\told, new;/a\\\n\
 #endif\n",
Index: fixincludes/tests/base/Xm/Traversal.h
===================================================================
--- fixincludes/tests/base/Xm/Traversal.h	(revision 143193)
+++ fixincludes/tests/base/Xm/Traversal.h	(working copy)
@@ -12,9 +12,9 @@
 #if defined( X11_NEW_CHECK )
 struct wedge {
 #ifdef __cplusplus
-	Widget	old, c_new;
+Widget	old, c_new;
 #else
-   Widget	old, new; /* fixinc check FAILS ON BSD */
+   Widget	old, new;
 #endif
 };
 extern Wedged( Widget c_new, Widget old );



More information about the Gcc-patches mailing list