|
Boost Users : |
From: Bobby Thomale (bobby-thomale_at_[hidden])
Date: 2002-10-23 09:48:15
Yesterday I was trying to help my wife get the Boost libraries to compile in
her application. It reminded me of an issue I thought I brought up a while
ago (maybe I forgot) that still exists in the boost Macos.hpp config file.
In the MacOS.hpp file, it checks to see if you are compiling a Mach-O
target. If you are, it reasons, you must be using the Apple BSD headers as
well. This logic is even documented in a comment:
// If __MACH__, we're using the BSD standard C library, not the MSL:
#if __MACH__
The problem with this is that, starting with CW Pro 8, it is actually
possible to build a Mach-O target and use the MSL in place of the BSD
libraries. Lots of people are apparently doing this, including my wife. (I
am still on CFM and have not made the transition to Mach-o yet, but I will
eventually and I will potentially be in the same boat. The newer Carbon
APIs are Mach-o only so that is where all the carbon programmers will
eventually go, and as long as Codewarrior is around, MSL will be there as an
option for people.)
There are also people who use other STL implementations, such as STLPORT.
When it defines all of the stuff it does in there, for the BSD libraries,
the mach-o MSL code does not compile. Instead, I get hundreds of compile
errors.
The only way I could get this to compile for her was to force it to use the
TARGET_CARBON stuff at the bottom, after the #else (meaning "not mach-o"),
by commenting the __MACH__ stuff out. Obviously, that was a "see if this is
really her problem" solution, also to get her up and running, and not a
long-term fix. :-) It worked by the way.
The config.hpp stuff seperates out your platform settings from your standard
library settings. Is there a reason that standard library
implementation-specific settings are being set by platform and binary
format? If there is magic that needs to happen that is specific to Apple's
BSD headers, shouldn't there maybe be a "BSD.hpp" or even "AppleBSD.hpp" for
BOOST_STDLIB_CONFIG instead?
Or am I missing something?
Anyway. That is just a question/suggestion, take it or leave it. It makes
sense that the TARGET_CARBON stuff at the bottom is platform specific, but
the stuff above it seems like it should go somewhere else.
In any case, whether that stuff is moved or not, something needs to change
to alleviate the pain for those using Mach-o and MSL together, because right
now boost is broken for those users.
(Am I reporting this to the right list by the way?)
-- Bobby
---------------------------------------------------------------------
Bobby Thomale
Senior Software Developer
Inoveon Corporation
http://www.inoveon.com/
---------------------------------------------------------------------
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net