I suspect that those other defs you mention are used in situations more tightly bound to Apple's own development tools (i.e. Project Builder), or at least for some other reason are not being defined in BSD/POSIX builds as opposed to Aqua/Obj-C/etc. builds.
But I'm not certain about that, so I can't really say anything except that the MACOSX and DARWIN tests (and several variations) don't work. ... Btw, for a list of some tests I tried that do and don't succeed, see my postscript below.
The only tests I came up with that do work are __ppc__ and the first one you list (which is what led me to the __APPLE__ test to begin with) which appears to have 2 out of 3 of it's test items defined.
It might be appropriate to use the full 3-item test, but I wasn't sure which was best. ... Not to mention that the sole, relevant i386-architecture header I found in OS X (that seemed relevant to me at least, though I by *no* means looked at *all* headers) appeared to test for __APPLE__ only, instead of for a combination of definitions. Which also led me to consider that "perhaps Apple knows something I don't." --- Hehehe! *snicker* As if that isn't obvious already!
Anyway, I'm still open to any other tests someone would like to suggest trying (which they feel are more appropriate), but I did actually test a few other options before settling on this one. ;-)
Other thoughts?
-James
P.S. Here's the summary of what works from what I tested -- which includes those you listed, Chad, plus several others. The failed ones are listed first as a group, then the successful ones.
=== Fail === #ifdef macintosh #ifdef MACOSX #ifdef DARWIN #ifdef __MACOSX__ #ifdef __DARWIN__ #ifdef MAC_OS_X #ifdef MAC_OS #ifdef TARGET_MAC_OS
=== Succeed === #if defined(macintosh) || (defined(__MACH__) && defined(__APPLE__)) #if (defined(__MACH__) && defined(__APPLE__)) #ifdef __ppc__ #ifdef __MACH__ #ifdef __APPLE__
So clearly, out of these only __ppc__, __MACH__ and __APPLE__ are being defined by any of the included headers. I used the most specific (Apple) version of the simplest (1 test) format when I inserted it into my code, but I don't know whether it's best to use the 3-, 2-, or 1-test version. -- While I do think the i386 header I mentioned above points a little toward the single test that I'm currently using, I can't convince even myself of that being "The Right Thing(tm)" to do with 100% certainty.
Anyway... What does everyone else say??
(Feel free to say I should just shut up and go to a more specific, Apple devel-related list, and come back with their answer... if you feel that's appropriate. Won't hurt my feelings...
...much. ;)
On Sunday, Mar 9, 2003, at 01:36 US/Central, Chad Leigh -- Shire.Net LLC wrote:
On Saturday, Mar 8, 2003, at 23:24 US/Mountain, James A Baker wrote:
File 5, and the final problem I had, was ./pcp/intl/libgnuintl.h which needed to have the following lines inserted at line 91:
#ifdef __APPLE__ # define _INTL_REDIRECT_MACROS 1 #endif
(I'm not sure __APPLE__ is the *best* thing to test for, but it *should* be unique enough... I think. Anyway, I figured __ppc__ was probably too general, in case someone used Linux-PPC or some such, which probably defines the same thing. But if you know of a more appropriate test, feel free to try using it instead. I'd be happy to test it by re-compiling. -- And again, if you want a patch file, I can make one.)
I went and searched through the system headers to see what Apple is using. I found the following things
#if defined(macintosh) || (defined(__MACH__) && defined(__APPLE__))
#if defined(MACOSX)
#if defined(DARWIN)
(as of 10.2.x, OS X uses gcc3 by default, I think).
I would choose the DARWIN one as DARWIN will most likely have the same problems and Mac OS X is Darwin with the GUI on top.
Chad
-------------------------------------------------------
This SF.net email is sponsored by: Etnus, makers of TotalView, The debugger for complex code. Debugging C/C++ programs can leave you feeling lost and disoriented. TotalView can help you find your way. Available on major UNIX and Linux platforms. Try it free. www.etnus.com
_______________________________________________
courier-users mailing list
[EMAIL PROTECTED]
Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-users
