• 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: C preprocessor macro
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: C preprocessor macro


  • Subject: Re: C preprocessor macro
  • From: Brian Smith <email@hidden>
  • Date: Sun, 11 Sep 2005 09:05:35 +0800

Hi Marc,

From the c99 standard there is __STDC__ which might be more appropriate. This is intended to indicate conformance so depending on the conformance of other compliers or if you have set the compiler to a non-conforming mode this may not be set. I'm not sure you will find anything completely reliable so it will have to be tested on different platforms and compilers.

Brian

On Sep 11, 2005, at 4:46 AM, Marc Poirier wrote:

This is a bit off-topic since it is not Xcode-specific, but I'm having trouble finding an answer so I thought I'd try here...

Is there a standard macro defined by C preprocessors that says, "Hello, I am a C preprocessor"? Kinda like there is __cplusplus for C++ preprocessors, I'm wondering if there is something like that for plain C. I have a header file that is included by some C files, some C++ files, and resource files, so I need to block out C- specific code so that Rez doesn't choke on it. Currently what I've found (and what I'm checking for) is __STDC_HOSTED__ which is defined (albeit sometimes as 0) by all C preprocessors that I've tried, though from what I've read about it, may not be defined by some C preprocessors in lower-than-C99 mode? So I'm wondering if this is a good choice or if there's a better and fully reliable macro to check.

thanks,
Marc
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40suaveware.com


This email sent to email@hidden



_______________________________________________ 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: 
 >C preprocessor macro (From: Marc Poirier <email@hidden>)

  • Prev by Date: C preprocessor macro
  • Next by Date: Re: App won't launch
  • Previous by thread: C preprocessor macro
  • Next by thread: Re: C preprocessor macro
  • Index(es):
    • Date
    • Thread