* fixinc/inclhack.def (ptx_netswap): New disabled fix, ported from
authorneroden <neroden@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 27 Aug 2003 16:22:50 +0000 (16:22 +0000)
committerneroden <neroden@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 27 Aug 2003 16:22:50 +0000 (16:22 +0000)
fixinc.ptx.
* fixinc/inclhack.def (undefine_null):  Don't generate \r characters.
Prettify a little.
* fixinc/fixincl.x: Regenerate.

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

gcc/ChangeLog
gcc/fixinc/fixincl.x
gcc/fixinc/inclhack.def

index 4d398dc..a37591d 100644 (file)
@@ -1,3 +1,11 @@
+2003-08-27  Nathanael Nerode  <neroden@gcc.gnu.org>
+
+       * fixinc/inclhack.def (ptx_netswap): New disabled fix, ported from
+       fixinc.ptx.
+       * fixinc/inclhack.def (undefine_null):  Don't generate \r characters.
+       Prettify a little.
+       * fixinc/fixincl.x: Regenerate.
+
 2003-08-27  Richard Earnshaw  <rearnsha@arm.com>
 
        * lib1funcs.asm (L_ieee754_sp): New.  Include ieee754-sf.S.
index c8ac74a..e730e47 100644 (file)
@@ -2,11 +2,11 @@
  * 
  * DO NOT EDIT THIS FILE   (fixincl.x)
  * 
- * It has been AutoGen-ed  Sunday August 24, 2003 at 03:26:44 PM EDT
+ * It has been AutoGen-ed  Wednesday August 27, 2003 at 12:21:31 PM EDT
  * From the definitions    inclhack.def
  * and the template file   fixincl
  */
-/* DO NOT CVS-MERGE THIS FILE, EITHER Sun Aug 24 15:26:44 EDT 2003
+/* DO NOT CVS-MERGE THIS FILE, EITHER Wed Aug 27 12:21:31 EDT 2003
  *
  * You must regenerate it.  Use the ./genfixes script.
  *
@@ -5664,11 +5664,11 @@ static tTestDesc aUndefine_NullTests[] = {
  */
 static const char* apzUndefine_NullPatch[] = {
     "format",
-    "#ifndef NULL%2\n\
-#define NULL%1%2\n\
-#endif%2\n",
-    "^#[ \t]*define[ \t]*[ \t]NULL([^\r\n\
-]+)([\r]*)\n",
+    "#ifndef NULL\n\
+#define NULL%1\n\
+#endif\n",
+    "^#[ \t]*define[ \t]+NULL([^\r\n\
+]+)[\r]*\n",
     (char*)NULL };
 
 /* * * * * * * * * * * * * * * * * * * * * * * * * *
index a5ec61f..a9472ae 100644 (file)
@@ -2017,6 +2017,31 @@ fix = {
 
 
 /*
+ * In netinet/in.h, the network byte swapping asm functions supported by the
+ * native cc compiler on PTX 1.x and 2.x are not supported by gcc.  Instead,
+ * include <sys/byteorder.h>, written out by fixincludes, which has
+ * these same routines written in an asm format supported by gcc.
+ */
+#ifdef PTX
+fix = {
+    hackname  = ptx_netswap;
+    files     = netinet/in.h;
+    sed       = "/#define NETSWAP/a\\\n"
+                "\\\n"
+                "#if defined (__GNUC__) || defined (__GNUG__)\\\n"
+                "#include <sys/byteorder.h>\\\n"
+                "#else  /* not __GNUC__ */\n";
+    sed       = "/#endif[ \t]*\\/\\* NETSWAP \\*\\//i\\\n"
+                "#endif /* not __GNUC__ */\n";
+    /* Half-hearted test case: I have no idea what the file this is really
+       supposed to operate on looks like. */
+    test_text = "#define NETSWAP\n"
+                "#endif /* NETSWAP */";
+};
+#endif
+
+
+/*
  * In pwd.h, PTX 1.x needs stdio.h included since FILE * was added in a
  * prototype later on in the file.  (It's not clear that this is
  * still true, and even if it is, FILE * may be added after this fix runs by
@@ -3442,6 +3467,8 @@ fix = {
 /*
  *  Fix multiple defines for NULL.  Sometimes, we stumble into \r\n
  *  terminated lines, so accommodate these.  Test both ways.
+ *  Don't bother to reproduce the \r\n termination, as GCC has to
+ *  recognize \n termination anyway.
  */
 fix = {
     hackname  = undefine_null;
@@ -3449,10 +3476,11 @@ fix = {
     bypass    = "#[ \t]*(ifn|un)def[ \t]+NULL($|[ \t\r])";
 
     c_fix     = format;
-    c_fix_arg = "#ifndef NULL%2\n#define NULL%1%2\n#endif%2\n";
-    c_fix_arg = "^#[ \t]*define[ \t]*[ \t]NULL([^\r\n]+)([\r]*)\n";
+    c_fix_arg = "#ifndef NULL\n#define NULL%1\n#endif\n";
+    c_fix_arg = "^#[ \t]*define[ \t]+NULL([^\r\n]+)[\r]*\n";
 
-    test_text = "#define NULL 0UL\r\n#define NULL\t((void*)0)\n";
+    test_text = "#define NULL 0UL\r\n"
+                "#define NULL\t((void*)0)\n";
 };
 
 /*