diff mbox

[ming32] : Fix OUTPUT_QUOTED_STRING macro argument expansion

Message ID BANLkTinqRu+2UzMVJEmqGA7WOfPRizyzUA@mail.gmail.com
State New
Headers show

Commit Message

Uros Bizjak May 18, 2011, 6:36 p.m. UTC
Hello!

This macro compiles by pure luck.

2011-05-18  Uros Bizjak  <ubizjak@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.

Comments

Uros Bizjak May 20, 2011, 2:50 p.m. UTC | #1
On Wed, May 18, 2011 at 8:36 PM, Uros Bizjak <ubizjak@gmail.com> wrote:

> 2011-05-18  Uros Bizjak  <ubizjak@gmail.com>
>
>        * config/i386/mingw32.h (OUTPUT_QUOTED_STRING): Fix macro
>        argument expansion.
>
> Patch was compile tested by crosscompiling to ming32 target.

I went ahead and commit this patch to mainline SVN under obvious rule.

Uros.
Kai Tietz May 20, 2011, 3:19 p.m. UTC | #2
2011/5/20 Uros Bizjak <ubizjak@gmail.com>:
> On Wed, May 18, 2011 at 8:36 PM, Uros Bizjak <ubizjak@gmail.com> wrote:
>
>> 2011-05-18  Uros Bizjak  <ubizjak@gmail.com>
>>
>>        * config/i386/mingw32.h (OUTPUT_QUOTED_STRING): Fix macro
>>        argument expansion.
>>
>> Patch was compile tested by crosscompiling to ming32 target.
>
> I went ahead and commit this patch to mainline SVN under obvious rule.
>
> Uros.

Sorry didn't noticed this thread. Yes, patch is ok.

Thanks,
Kai
diff mbox

Patch

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.  */