• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Preprocessor, problem
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >Preprocessor, problem (From: Tommy Nordgren <email@hidden>)

  • Prev by Date: Debugging an arbitrary application
  • Next by Date: Re: thin linking: "file is not of required architecture"
  • Previous by thread: Preprocessor, problem
  • Next by thread: problems compiling Xcode 2.4.1 project in 2.5/3.1
  • Index(es):
    • Date
    • Thread