Hello!

This macro compiles by pure luck.

2011-05-18  Uros Bizjak  <ubiz...@gmail.com>

        * config/i386/mingw32.h (OUTPUT_QUOTED_STRING): Fix macro
        argument expansion.

Patch was compile tested by crosscompiling to ming32 target.

OK for mainline?

Uros.
Index: mingw32.h
===================================================================
--- mingw32.h   (revision 173864)
+++ mingw32.h   (working copy)
@@ -160,11 +160,12 @@ along with GCC; see the file COPYING3.  
 #undef OUTPUT_QUOTED_STRING
 #define OUTPUT_QUOTED_STRING(FILE, STRING)               \
 do {                                                    \
+  const char *_string = (const char *) (STRING);        \
   char c;                                               \
                                                         \
-  putc ('\"', asm_file);                                \
+  putc ('\"', (FILE));                                  \
                                                         \
-  while ((c = *string++) != 0)                          \
+  while ((c = *_string++) != 0)                                 \
     {                                                   \
       if (c == '\\')                                    \
        c = '/';                                         \
@@ -172,14 +173,14 @@ do {                                                      
 \
       if (ISPRINT (c))                                   \
         {                                                \
           if (c == '\"')                                \
-           putc ('\\', asm_file);                       \
-          putc (c, asm_file);                           \
+           putc ('\\', (FILE));                         \
+          putc (c, (FILE));                             \
         }                                                \
       else                                               \
-        fprintf (asm_file, "\\%03o", (unsigned char) c); \
+        fprintf ((FILE), "\\%03o", (unsigned char) c);  \
     }                                                   \
                                                         \
-  putc ('\"', asm_file);                                \
+  putc ('\"', (FILE));                                  \
 } while (0)
 
 /* Define as short unsigned for compatibility with MS runtime.  */

Reply via email to