Re: xcode 1.5 preprocessor
Re: xcode 1.5 preprocessor
- Subject: Re: xcode 1.5 preprocessor
- From: Bret Kurth <email@hidden>
- Date: Fri, 10 Sep 2004 15:28:35 -0500
On Sep 10, 2004, at 3:14 PM, Fritz Anderson wrote:
Mnph. Illuminating. I have no ideas except for further avenues for
investigation...
Is __unix the only symbol defined in Preprocessor Macros? If not, are
the symbols delimited only by spaces?
It was one of a collection but I removed the others completely and
concentrated strictly on __unix to try and get to the root of the
problem.
What happens if you blank-out Preprocessor Macros and re-enter __unix?
(You've probably done this.)
Have tried.
Examine the build log (force a rebuild and then open the middle split
pane of the "Build -> Detailed Build Results" window) and see if -D
__unix appears in the compiler invocations. (I understand it's broken,
I want to know _where_.)
-D__unix does not appear.
Have you accidentally overridden Preprocessor Macros in the current
build style (is the entry bold in the build-style listing, or
crossed-out in the target Build settings)? Accidentally setting it,
repenting, and blanking-out the field can result in overriding the
setting to blank, rather than removing the setting from the build
style. You have to press the "-" button to remove the set-to-blank
override (which is a disturbing button to use for the purpose, but I
admit having no better idea).
The entry in the target settings is bold and not crossed out. On a
related note that "disturbing" button/feature has bitten me many times
before but not this time. =)
I have blanked it using the nasty little button and re-entered only
__unix in the field to no avail. I have created a precompiled header
file (prefix.pch) and placed in it
#define __unix 1
This is a viable work-around but leaves me wondering what happened to
cause the build setting feature to cease functioning?
Bret
-- F
On 10 Sep 2004, at 2:32 PM, Bret Kurth wrote:
In the Target build options there is a settings line item called
"Preprocessor Macros". The value is a text field where I had entered
"__unix". I know this was being automagically defined before as
preprocessor conditional code in a header file for different
platforms was correctly defined based off the state of my macro.
Simply updating the project to xcode 1.5 caused the preprocessor
conditional code to be defined incorrectly because "__unix" no longer
gets defined. i.e:
#ifdef __unix
#define DLLOPT
#else
#define DLLOPT __declspec(dllexport) (something that wont naturally
compile on a mac)
#endif
class DLLOPT foo {
public:
}
Again this worked using XCode 1.2. Note I did not change versions of
GCC. When the compiler hits the class definition of foo, it sees the
__declspec(dllexport) garbage in front of the class name implying
that "__unix" is not defined for the scope that file and subsequently
chokes.
--
Fritz Anderson
Consulting Programmer Chicago, Illinois
http://resume.manoverboard.org/
_______________________________________________
xcode-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/xcode-users
Do not post admin requests to the list. They will be ignored.