Preprocessor macro concatenation...
Preprocessor macro concatenation...
- Subject: Preprocessor macro concatenation...
- From: Ralf Hasemann <email@hidden>
- Date: Thu, 7 Sep 2006 21:55:27 +0200
Hi all!
this is not a real Cocoa question - I hope that don't mind.
I am "fighting" adainst the C preprocessor at the moment.
What I like to do is create a #define that does the following:
Inserting a variable with the current source code line number in its
name.
Example:
NSString* strNr_25 = [NSString string];
Where 25 is the number of the line in the code file.
The standard predefined macro __LINE__ inserts the current line number.
So far - so good.
but when I try the following:
#define LineString NSString* strNr___LINE__ = [NSString string];
the __LINE__ macro is not replaced because it is joint to "strNr_"
and therefore
not recognized by the preprocessor.
The question is now: Is the a way (a trick / hack) to concatenate the
__LINE__
macro with a string within a define??
Thank you for any help!
Regards,
Ralf Hasemann
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden