• 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: TargetConditionals.h + llvm + iphone or Mac conditionals
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: TargetConditionals.h + llvm + iphone or Mac conditionals


  • Subject: Re: TargetConditionals.h + llvm + iphone or Mac conditionals
  • From: Jens Alfke <email@hidden>
  • Date: Fri, 24 Jun 2011 11:47:28 -0700

On Jun 24, 2011, at 11:36 AM, David Hoerl wrote:

> I need to conditionally compile some code based on whether its targetted to the iPhone or the Mac. iPhone should work on both the device and the simulator.

I use TARGET_OS_IPHONE and TARGET_IPHONE_SIMULATOR for that, and haven’t had any trouble with different compilers.

> There use to be this file TargetConditionals.h with a bunch of conditionals, but its only useful for GCC.

The header comment says:

	Note:  TargetConditionals.h in 3.4 Universal Interfaces works
	with all compilers.  This header only recognizes compilers
	known to run on Mac OS X.

It’s true that the definitions are wrapped in an #ifdef that checks __GNUC__, but I suspect that flag is defined even under Clang/LLVM since it supports the GNU language extensions.

—Jens

Attachment: smime.p7s
Description: S/MIME cryptographic signature

 _______________________________________________
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: 
 >TargetConditionals.h + llvm + iphone or Mac conditionals (From: David Hoerl <email@hidden>)

  • Prev by Date: TargetConditionals.h + llvm + iphone or Mac conditionals
  • Next by Date: Re: Xcode-users Digest, Vol 8, Issue 218
  • Previous by thread: TargetConditionals.h + llvm + iphone or Mac conditionals
  • Next by thread: Re: Xcode-users Digest, Vol 8, Issue 218
  • Index(es):
    • Date
    • Thread