|Nov 6, 2010, 01:46 AM||#1|
What kind of #if(compiler if) statements are available?
I hope I explained that well, but I'm talking about the #if statements that you can put into code, which tells the compiler to only compile a section of code if the condition is met. I've noticed a bunch in the Apple-provided headers, and I'm wondering, is there some kind of resource about what kind of conditions are available to put into these compiler statements?
|Nov 6, 2010, 02:22 AM||#2|
All the standard C preprocessor directives should be available, including #if, #ifdef, #ifndef, #else, #elif and #endif. I don't think there's much that applies in an Objective-C context that would be different than in a straight C context.
EDIT: You'll notice there are some restrictions, for example you can't evaluate expressions using strings or floats, generally you can do that before the directive by defining a token and using #ifdef, or using an integer expression with #if.
Go outside, the graphics are amazing!
Last edited by HiRez; Nov 6, 2010 at 02:28 AM.
|Nov 6, 2010, 10:22 AM||#3|
Thank you, I didn't know the term preprocessor, and that's exactly what I was looking at, but I don't think I explained my question very well. It's not the different preprocessor directives that I'm looking for, it's more the different expressions that I can put into a preprocessor #if statement. For example, in foundation.h, there's a conditional compilation based on the statement;
#if (TARGET_OS_MAC && !(TARGET_OS_EMBEDDED || TARGET_OS_IPHONE)) || TARGET_OS_WIN32
Last edited by BadWolf13; Nov 6, 2010 at 12:30 PM.
|Nov 7, 2010, 12:06 PM||#5|
Thanks, that's a good idea, unfortunately when I ctrl-click on the macro, the "Jump to Definition" is greyed out? Could there be a setting in XCode that's preventing me from using this?
Also, a spotlight search won't find either of those two files that you listed. Back when I used Windows, there were "hidden files", does OXS do anything like that?
|Thread Tools||Search this Thread|
|thread||Thread Starter||Forum||Replies||Last Post|
|Watch your credit card statements!||Michael73||Mac Pro||0||Apr 15, 2014 02:55 PM|
|IF/THEN statements in numbers||BrandonIrby||Mac Applications and Mac App Store||1||Jan 7, 2013 10:04 AM|
|Help. I Failed! What kind of Canon Lens Can Achieve This Kind of Look?||VideoNewbie||Digital Video||29||Dec 7, 2012 09:18 PM|
|Geektool: If Statements||itsme932||UI Customization||1||Nov 28, 2012 11:47 PM|
|If Statements||eForce||iPhone/iPad Programming||8||Oct 21, 2012 02:02 PM|
All times are GMT -5. The time now is 12:34 PM.