On Nov 20, 2007, at 7:55 PM, Rich Morin wrote:

> At 15:36 +0100 11/20/07, Joerg Schilling wrote:
>> If you convert to ## and if Dtrace on Solaris still calls
>> /lib/cpp, it will no longer work on Solaris.
>>
>> Check the __CONCAT__ macro in /usr/include/sys/*.h
>
> Well, "grep __CONCAT__ /usr/include/sys/*.h" comes up empty
> on Leopard, so no help there.  However, Googling about, I do
> see some examples of __CONCAT__ definitions.
>
> I wonder if I need to do something like this, for portability:
>
>  #if __APPLE__
>  #define __CONCAT__(A,B) A ## B
>  #else
>  #define __CONCAT__(A,B) A/**/B
>  #endif
>
> then use __CONCAT__ in the following code.  Problem is, I
> don't know what the #if test should be.  __APPLE__ is a bit
> too specific...
>
> Comments?  Clues?  Suggestions?

        One more thing I just noticed. There is a "__CONCAT"
in /usr/include/sys/cdefs.h:

/*
  * The __CONCAT macro is used to concatenate parts of symbol names,  
e.g.
  * with "#define OLD(foo) __CONCAT(old,foo)", OLD(foo) produces oldfoo.
  * The __CONCAT macro is a bit tricky -- make sure you don't put spaces
  * in between its arguments.  __CONCAT can also concatenate double- 
quoted
  * strings produced by the __STRING macro, but this only works with  
ANSI C.
  */

        James M

_______________________________________________
dtrace-discuss mailing list
[email protected]

Reply via email to