Evil preprocessor hack of the day [entries|reading|network|archive]
simont

[ userinfo | dreamwidth userinfo ]
[ archive | journal archive ]

Wed 2007-04-18 17:39
Evil preprocessor hack of the day
LinkReply
[identity profile] geekette8.livejournal.comWed 2007-04-18 19:55
OK, I have done [what I consider to be relatively] complicated things with the C pre-processor, but I don't understand why you needed two levels of CAT definition. What's wrong with
#define CAT(x,y) x ## y
?
Link Reply to this | Thread
[personal profile] simontWed 2007-04-18 20:07
If you do that, then CAT(foo,__LINE__) gives you the fixed token foo__LINE__, instead of giving you foo23 or foo5097 or other such things.
Link Reply to this | Parent | Thread
[identity profile] geekette8.livejournal.comWed 2007-04-18 20:42
Ah, gotcha. Thank you!
Link Reply to this | Parent
navigation
[ go | Previous Entry | Next Entry ]
[ add | to Memories ]