Re: Preprocessor, problem
Re: Preprocessor, problem
- Subject: Re: Preprocessor, problem
- From: Chris Espinosa <email@hidden>
- Date: Mon, 21 Apr 2008 14:47:11 -0700
On Apr 18, 2008, at 4:58 PM, Tommy Nordgren wrote:
How can I find out from the preprocessor if I am compiling with
Garbage Collection
Settings required or supported?
I've tried the following commands:
touch file.m
gcc -E -dM -fobjc-gc-required file.m | sort | edit
But the list of preprocessor symbols I get don't seem to contain any
testable symbol for gc.
Tried google, but did not find relevant hits for Word: preprocessor
&& Phrase "Objective c garbage collection"
You generally can't.
You can discover at runtime whether you are running under GC or not:
[NSGarbageCollector defaultCollector] == NIL
If you really need to know at build time, define this Preprocessor
Macro Not User By Precompiled Headers:
GC_$(GC_ENABLE_OBJC_GC)
and in your code you can use:
#ifdef GC_supported
#ifdef GC_required
#if defined(GC_supported) || defined(GC_required)
etc. But I'd only do that for testing and prototyping.
Chris
_______________________________________________
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