Re: build numbers
Re: build numbers
- Subject: Re: build numbers
- From: "M. Uli Kusterer" <email@hidden>
- Date: Thu, 16 Sep 2004 15:42:44 +0200
At 8:20 Uhr -0400 16.09.2004, J Nozzi wrote:
On Sep 16, 2004, at 8:03 AM, M. Uli Kusterer wrote:
__DATE__ and __TIME__ are official preprocessor macros.
On that note, where might one find documentation that provides a
list of useful preprocessor macros like these? I've only recently
begun making use of this (and don't know why I didn't start sooner)
and it'd be nice to have a good cheat sheet of pre-defined macros.
Depends. These two (and __FILE__ and __LINE__) are part of the
ANSI/ISO C standard, so you'll find them in any good C reference. And
even my not really good C/C++ quick reference includes them. If you
have K&R (2nd Ed., Prentice Hall), they're all listed on page 233.
For others, you'll want to check the compiler docs. E.g. CodeWarrior
defines a constant named something like __MWERKS__ that lets you
detect whether you're being compiled with CodeWarrior.
Another good source if you don't mind reading code is
/usr/include/TargetConditionals.h -- it contains code that checks for
all sorts of compiler features by different compilers. But note that
this is a Mac-specific header. Part of this used to be in
<ConditionalMacros.h> under MacOS 9, and <TargetConditionals.h> is a
Carbon-specific MacOS X header, AFAIK. (Note: I just checked, and it
looks like Apple finally stripped all the other compilers from this
file -- so it's not really that interesting anymore)
A quick google for "builtin macro" or "predefined macro" also brings
up some nice things:
http://developer.apple.com/documentation/DeveloperTools/gcc-3.3/cpp/Common-Predefined-Macros.html
--
Cheers,
M. Uli Kusterer
------------------------------------------------------------
"The Witnesses of TeachText are everywhere..."
http://www.zathras.de
_______________________________________________
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