Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [commit] Rename STRINGIFY (Re: Macro conflict in gdb/opencl-lang.c)
       [not found] <4D483FE0.70700@sw.ru>
@ 2011-02-02 13:50 ` Ulrich Weigand
  2011-02-02 14:07   ` Joel Brobecker
  0 siblings, 1 reply; 3+ messages in thread
From: Ulrich Weigand @ 2011-02-02 13:50 UTC (permalink / raw)
  To: Vladimir Simonov, gdb-patches; +Cc: gdb

Vladimir Simonov wrote:

> Macro STRINGIFY conflicts with
> mingw64 internal include:

That's a bit unfortunate, such includes shouldn't really
intrude on the user namespace ...

Anyway, I've now checked in the following patch.

Bye,
Ulrich

ChangeLog:

	* opencl-lang.c (STRINGIFY): Rename to OCL_STRING.
	(BUILD_OCL_VTYPES): Update.

Index: gdb/opencl-lang.c
===================================================================
RCS file: /cvs/src/src/gdb/opencl-lang.c,v
retrieving revision 1.4
diff -u -p -r1.4 opencl-lang.c
--- gdb/opencl-lang.c	10 Jan 2011 20:38:49 -0000	1.4
+++ gdb/opencl-lang.c	2 Feb 2011 13:42:20 -0000
@@ -1116,27 +1116,27 @@ build_opencl_types (struct gdbarch *gdba
     = GDBARCH_OBSTACK_ZALLOC (gdbarch, struct builtin_opencl_type);
 
 /* Helper macro to create strings.  */
-#define STRINGIFY(S) #S
+#define OCL_STRING(S) #S
 /* This macro allocates and assigns the type struct pointers
    for the vector types.  */
 #define BUILD_OCL_VTYPES(TYPE)\
   builtin_opencl_type->builtin_##TYPE##2\
     = init_vector_type (builtin_opencl_type->builtin_##TYPE, 2);\
-  TYPE_NAME (builtin_opencl_type->builtin_##TYPE##2) = STRINGIFY(TYPE ## 2);\
+  TYPE_NAME (builtin_opencl_type->builtin_##TYPE##2) = OCL_STRING(TYPE ## 2);\
   builtin_opencl_type->builtin_##TYPE##3\
     = init_vector_type (builtin_opencl_type->builtin_##TYPE, 3);\
-  TYPE_NAME (builtin_opencl_type->builtin_##TYPE##3) = STRINGIFY(TYPE ## 3);\
+  TYPE_NAME (builtin_opencl_type->builtin_##TYPE##3) = OCL_STRING(TYPE ## 3);\
   TYPE_LENGTH (builtin_opencl_type->builtin_##TYPE##3)\
     = 4 * TYPE_LENGTH (builtin_opencl_type->builtin_##TYPE);\
   builtin_opencl_type->builtin_##TYPE##4\
     = init_vector_type (builtin_opencl_type->builtin_##TYPE, 4);\
-  TYPE_NAME (builtin_opencl_type->builtin_##TYPE##4) = STRINGIFY(TYPE ## 4);\
+  TYPE_NAME (builtin_opencl_type->builtin_##TYPE##4) = OCL_STRING(TYPE ## 4);\
   builtin_opencl_type->builtin_##TYPE##8\
     = init_vector_type (builtin_opencl_type->builtin_##TYPE, 8);\
-  TYPE_NAME (builtin_opencl_type->builtin_##TYPE##8) = STRINGIFY(TYPE ## 8);\
+  TYPE_NAME (builtin_opencl_type->builtin_##TYPE##8) = OCL_STRING(TYPE ## 8);\
   builtin_opencl_type->builtin_##TYPE##16\
     = init_vector_type (builtin_opencl_type->builtin_##TYPE, 16);\
-  TYPE_NAME (builtin_opencl_type->builtin_##TYPE##16) = STRINGIFY(TYPE ## 16)
+  TYPE_NAME (builtin_opencl_type->builtin_##TYPE##16) = OCL_STRING(TYPE ## 16)
 
   builtin_opencl_type->builtin_char
     = arch_integer_type (gdbarch, 8, 0, "char");



-- 
  Dr. Ulrich Weigand
  GNU Toolchain for Linux on System z and Cell BE
  Ulrich.Weigand@de.ibm.com


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [commit] Rename STRINGIFY (Re: Macro conflict in gdb/opencl-lang.c)
  2011-02-02 13:50 ` [commit] Rename STRINGIFY (Re: Macro conflict in gdb/opencl-lang.c) Ulrich Weigand
@ 2011-02-02 14:07   ` Joel Brobecker
  2011-02-02 14:59     ` Vladimir Simonov
  0 siblings, 1 reply; 3+ messages in thread
From: Joel Brobecker @ 2011-02-02 14:07 UTC (permalink / raw)
  To: Ulrich Weigand; +Cc: Vladimir Simonov, gdb-patches, gdb

> > Macro STRINGIFY conflicts with
> > mingw64 internal include:
> 
> That's a bit unfortunate, such includes shouldn't really
> intrude on the user namespace ...

What I don't understand is why I am not seeing the problem...
I've just successfully rebuilt GDB on x64 Windows, and the include
in question does have the STRINGIFY macro.

> ChangeLog:
> 
> 	* opencl-lang.c (STRINGIFY): Rename to OCL_STRING.
> 	(BUILD_OCL_VTYPES): Update.

Thanks for taking care of the problem, though.


-- 
Joel


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [commit] Rename STRINGIFY (Re: Macro conflict in gdb/opencl-lang.c)
  2011-02-02 14:07   ` Joel Brobecker
@ 2011-02-02 14:59     ` Vladimir Simonov
  0 siblings, 0 replies; 3+ messages in thread
From: Vladimir Simonov @ 2011-02-02 14:59 UTC (permalink / raw)
  To: Joel Brobecker; +Cc: Ulrich Weigand, gdb-patches, gdb

On 02/02/2011 05:07 PM, Joel Brobecker wrote:
>>> Macro STRINGIFY conflicts with
>>> mingw64 internal include:
>>
>> That's a bit unfortunate, such includes shouldn't really
>> intrude on the user namespace ...
>
> What I don't understand is why I am not seeing the problem...
> I've just successfully rebuilt GDB on x64 Windows, and the include
> in question does have the STRINGIFY macro.
>
>> ChangeLog:
>>
>> 	* opencl-lang.c (STRINGIFY): Rename to OCL_STRING.
>> 	(BUILD_OCL_VTYPES): Update.
>
> Thanks for taking care of the problem, though.
>
>

Looks like my mingw a bit old - mingw-w64-snapshot-20090419
The current one doesn't have a problem:
mingw-w64-v1.0-20101003/mingw-w64-headers/include/ChangeLog
2009-12-04  Jonathan Yong  <jon_y@users.sourceforge.net>

         * _mingw_mac.h (STRINGIFY): Rename to __MINGW64_STRINGIFY
         (__MINGW64_VERSION_STR): Use __MINGW64_STRINGIFY

Ulrich, thank you for fix.

Best regards
Vladimir Simonov


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-02-02 14:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <4D483FE0.70700@sw.ru>
2011-02-02 13:50 ` [commit] Rename STRINGIFY (Re: Macro conflict in gdb/opencl-lang.c) Ulrich Weigand
2011-02-02 14:07   ` Joel Brobecker
2011-02-02 14:59     ` Vladimir Simonov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox