on 6/6/02 6:17 AM, John Maddock at john_maddock@compuserve.com wrote:
Is PowerPlant a third party lib? If so then I don't think it should be setting a reserved symbol like __MACH__, however it's easy enough to change the boost code to verify that __MACH__ is greater than zero, so I'll make that change anyway unless there are objections (any Darwin experts out there?).
PowerPlant is an application framework written by Metrowerks and distributed with CodeWarrior. It is a very widely used framework in the Mac world (probably as widely used as MFC is on Windows). FWIW that was my first thought too - why are they even defining this? But if Mac programmers are going to try to use Boost, keeping it compatible with PowerPlant is a good idea. (I'll be sure and post about any other issues I find - so far this is the only one!) I got an interesting response when I posted this same question to the Metrowerks newsgroup, from a MW employee. The comment before the test says it is trying to determine whether BSD or MSL libraries are being used. CodeWarrior Pro 8 allows you to choose either MSL or BSD standard library implementations in Mach-O binaries, so testing for __MACH__ will no longer be a sufficient test. (The following commented section was originally posted to the comp.sys.mac.programmer.codewarrior newsgroup by Josef W. Wankerl of Metrowerks):
That may have worked with Pro 7, since it was true that whenever __MACH__ was defined, the BSD headers and libraries were being used.
For Pro 8, that's changed since you now have the option to use MSL C. The test should be something like:
#if __MACH__ #include
/* Get __MSL__ and _MSL_USING_MW_C_HEADERS */ #if (__MSL__ >= 0x8000) && _MSL_USING_MW_C_HEADERS /* MSL C is being used */ #else /* BSD C is being used */ #endif #endif
As a further bit of clarification to the above code - the test (__MSL__ >= 0x8000) is testing for the version of the MSL libraries - it only tests for using MSL headers with Mach on Pro 8 or later, because that is when it was added. -- Bobby --------------------------------------------------------------------- Bobby Thomale Senior Software Developer Inoveon Corporation http://www.inoveon.com/ ---------------------------------------------------------------------