• 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: crossplatform C++, #ifdef
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: crossplatform C++, #ifdef


  • Subject: Re: crossplatform C++, #ifdef
  • From: Matthew Farrellee <email@hidden>
  • Date: Sun, 14 Nov 2004 10:38:27 -0600

A "correct" way would probably be to use uname and define your own platform identifying macros. The closest you might be able to get without that is using some combination of the macros you find when doing cpp -dM. A common combination seems to be __APPLE__ and __MACH__, but that is hardly going to work across compilers.


matt

On Nov 14, 2004, at 7:26 AM, Finlay Dobbie wrote:

On Sat, 13 Nov 2004 12:16:28 -0600, Matthew Farrellee <email@hidden> wrote:
 From the gcc manual page, you can run "touch foo.h; cpp -dM foo.h" on
the command-line to see what is #define'd for you by the compiler.

It seem __APPLE__ is defined for GCC 3.3 (and 3.1 for that matter).

Yes, but what does __APPLE__ actually tell you? AFAIK it tells you that you're compiling using an Apple compiler. What happens if you're compiling using CW? Or xlc?

While it might work in most situations, it's not "correct".

-- Finlay

_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
  • Follow-Ups:
    • Re: crossplatform C++, #ifdef
      • From: Finlay Dobbie <email@hidden>
References: 
 >Re: crossplatform C++, #ifdef (From: Eric Forget <email@hidden>)
 >Re: crossplatform C++, #ifdef (From: Jean-Francois Roy <email@hidden>)
 >Re: crossplatform C++, #ifdef (From: Phillip Mills <email@hidden>)
 >Re: crossplatform C++, #ifdef (From: Finlay Dobbie <email@hidden>)
 >Re: crossplatform C++, #ifdef (From: Matthew Farrellee <email@hidden>)
 >Re: crossplatform C++, #ifdef (From: Finlay Dobbie <email@hidden>)

  • Prev by Date: Re: Window floating on top no matter what...
  • Next by Date: Re: crossplatform C++, #ifdef
  • Previous by thread: Re: crossplatform C++, #ifdef
  • Next by thread: Re: crossplatform C++, #ifdef
  • Index(es):
    • Date
    • Thread