Re: #pragma message(). Was 'AliasRecord'...
Re: #pragma message(). Was 'AliasRecord'...
- Subject: Re: #pragma message(). Was 'AliasRecord'...
- From: Jerry Krinock <email@hidden>
- Date: Fri, 20 Jan 2006 05:46:06 -0800
- Thread-topic: #pragma message(). Was 'AliasRecord'...
on 06/01/19 12:12, Fritz Anderson at email@hidden wrote:
> There is no #pragma message() in GCC. Place a #warning directive,
> with whatever text you like, where you'd use #pragma message().
Fritz, I still don't know where you find this documentation, but thank you.
It works.
Now, I have a more difficult challenge. Eric's #if seems like it never
fires regardless of MAC_OS_X_DEPLOYMENT_TARGET, so I'd like to log what
those macros are defined to. In CodeWarrior, somone taught me how to do
this it as shown below. This may not be possible with #warning, since
#warning seems to just take whatever is on the rest of the line literally;
it does not use quotes or parentheses. Can anyone show me how to do this:
#define STRINGIFIER(theString) #theString
#define VALUE_OF(theString) STRINGIFIER(theString)
// Examples of using these:
// Demo, with a user-defined macro
#define MY_DEMO_MACRO 7
#pragma message( "The value of MY_DEMO_MACRO is " VALUE_OF( MY_DEMO_MACRO )
)
// Demo, with an built-in macro
#pragma message( "The CodeWarrior version is " VALUE_OF( __MWERKS__ ) )
// Demo, with a nonexisting macro
#pragma message( "The value of an undefined macro is itself: " VALUE_OF(
THIS_MACRO_HAS_NOT_BEEN_DEFINED ) )
Jerry Krinock
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden