• 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: I need to know which compiler or environment my code is being compiled in . . .
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: I need to know which compiler or environment my code is being compiled in . . .


  • Subject: Re: I need to know which compiler or environment my code is being compiled in . . .
  • From: Chris Espinosa <email@hidden>
  • Date: Fri, 7 Aug 2009 14:50:42 -0700

On Aug 7, 2009, at 1:31 PM, Michael A. Crawford wrote:

Hi, I'm looking for information on Xcode or the preprocessor that would indicate whether or not my code is being compiled for a non Mac GNU target or Mac OS X or iPhone OS.

What are the relevant defines and where can I find them in the documentation?  Apparently I'm not using the correct keywords in my Google search or Xcode's documentation search window.

The compiler sets certain predefined macros based on its invocation flags, and others are derived in TargetConditionals.h 

The specific droids you're looking for:


    TARGET_OS_* 
    These conditionals specify in which Operating System the generated code will
    run. The MAC/WIN32/UNIX conditionals are mutually exclusive.  The EMBEDDED/IPHONE 
conditionals are variants of TARGET_OS_MAC. 

        TARGET_OS_MAC           - Generate code will run under Mac OS
        TARGET_OS_WIN32         - Generate code will run under 32-bit Windows
        TARGET_OS_UNIX          - Generate code will run under some non Mac OS X unix 
        TARGET_OS_EMBEDDED      - Generate code will run under an embedded OS variant
                                  of TARGET_OS_MAC
        TARGET_OS_IPHONE        - Generate code will run under iPhone OS which 
                                  is a variant of TARGET_OS_MAC.

 _______________________________________________
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: 
 >I need to know which compiler or environment my code is being compiled in . . . (From: "Michael A. Crawford" <email@hidden>)

  • Prev by Date: I need to know which compiler or environment my code is being compiled in . . .
  • Next by Date: Re: I need to know which compiler or environment my code is being compiled in . . .
  • Previous by thread: I need to know which compiler or environment my code is being compiled in . . .
  • Next by thread: Re: I need to know which compiler or environment my code is being compiled in . . .
  • Index(es):
    • Date
    • Thread