CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

preprocessor token pasting

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Ramey



Joined: 11 Sep 2007
Posts: 18

View user's profile Send private message

preprocessor token pasting
PostPosted: Tue Jan 29, 2008 12:35 am     Reply with quote

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
Ttelmah
Guest







PostPosted: Tue Jan 29, 2008 3:38 am     Reply with quote

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
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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