This is the mail archive of the gcc@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]
Other format: [Raw text]

Re: building 3.1 branch on Cygwin


Here's a better patch that builds under Cygwin. If this is OK, what's 
the process to get this into the repository?

I've only built it with 'make bootstrap' and 'make install' and the C 
compiler works on a trivial program. I can't get the C++ compiler to 
link but I think that's another problem having to do with my environment.

Index: gcc/genflags.c
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/genflags.c,v
retrieving revision 1.42
diff -u -r1.42 genflags.c
--- gcc/genflags.c    2 Dec 2001 00:04:19 -0000    1.42
+++ gcc/genflags.c    11 Mar 2002 18:11:14 -0000
@@ -201,8 +201,8 @@
       printf ("(");
       for (p = XSTR (insn, 2); *p; p++)
     {
-      if (*p == '\n')
-        printf (" \\\n");
+      if (IS_VSPACE(*p))
+        printf (" ");
       else
         printf ("%c", *p);
     }
Index: gcc/genoutput.c
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/genoutput.c,v
retrieving revision 1.68.6.1
diff -u -r1.68.6.1 genoutput.c
--- gcc/genoutput.c    7 Mar 2002 22:05:38 -0000    1.68.6.1
+++ gcc/genoutput.c    11 Mar 2002 18:11:14 -0000
@@ -366,8 +366,12 @@
         printf ("    \"");
         while (*p)
           {
-        if (*p == '\n' && prev != '\\')
-          printf ("\\n\\\n");
+        if (IS_VSPACE(*p) && prev != '\\')
+          {
+            /* preserve two consecutive \n's or \r's but treat \r\n as 
a single \n */
+            if (*p != '\n' || prev != '\r')
+              printf ("\\n\\\n");
+          }
         else
           putchar (*p);
         prev = *p;
@@ -694,11 +698,11 @@
 
       for (i = 0, cp = &template[1]; *cp; )
     {
-      while (*cp == '\n' || *cp == ' ' || *cp== '\t')
+      while (ISSPACE(*cp))
         cp++;
 
       printf ("  \"");
-      while (*cp != '\n' && *cp != '\0')
+      while (!IS_VSPACE(*cp) && (*cp != '\0'))
         {
           putchar (*cp);
           cp++;


>On Thu, Mar 07, 2002 at 03:19:10PM -0800, Chris Meyer wrote:
>
>>Hi Neil,
>>
>>Here's the updated patch using the macros.
>>
>
>I don't think this bit
>
>>-        if (*p == '\n' && prev != '\\')
>>+        if (IS_VSPACE(*p) && prev != '\\')
>>          printf ("\\n\\\n");
>>
>
>does what you want.  DOS line breaks are \r\n; I think the above will
>turn " \r\n" into " \\n\\\n\\n\\\n"  (i.e. introducing an extra blank
>line).  Also, it leaves a backslashed newline alone, which may cause
>problems with a compiler that treats \r as horizontal white space.
>
>The rest of it appears to be safe.
>
>zw
>




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