View previous topic :: View next topic |
Author |
Message |
Ramey
Joined: 11 Sep 2007 Posts: 18
|
preprocessor token pasting |
Posted: Tue Jan 29, 2008 12:35 am |
|
|
I've written
#define CODE(n, c, m, d, u) INDEX_CODE_ ## n,
which intended to expand the following
CODE(NULL, 0, 0, 0, 0)
to:
INDEX_CODE_NULL
but fails to do so. It seems that the ANSI C pre-processor operator ## doesn't work. Does anyone know anything about this. Is there some sort of way to get the same effect?
Robert Ramey |
|
![](templates/subSilver/images/spacer.gif) |
Ttelmah Guest
|
|
Posted: Tue Jan 29, 2008 3:38 am |
|
|
There must not be a space between the '##', and the 'n', to get the 'one piece' result required in CCS.
Also, you may have a problem, if you have stddef.h loaded (which is automatically loaded by several of the other include files), since CCS, does not have/support a 'NULL' data type, and therefore has it defined in this file as '0'. So your line expands as:
INDEX_CODE_0
If this is already included...
Best Wishes |
|
![](templates/subSilver/images/spacer.gif) |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|