Boost logo

Boost :

From: Jesse Jones (jesjones_at_[hidden])
Date: 2001-11-08 13:17:42


At 9:51 AM -0500 11/8/01, Howard Hinnant wrote:
>On Thursday, November 8, 2001, at 07:29 AM, Peter Dimov wrote:
>
>> From: "Darin Adler" <darin_at_[hidden]>
>>> I'll fix this. The simplest fix is probably to add an unconditional
> >> BOOST_HAS_THREADS define to metrowerks.hpp. This makes it clear that
>>> CodeWarrior is effectively always in "multi-threaded mode".
>>
>> Is it? Even on Win32, or Playstation 2, or whatever other platforms CW
>> targets?
>
>For the C and C++ libs to be in "multi-threaded mode", "multi-threaded
>mode" _MWMT must be defined to 1. This can be done either in a prefix
>file (included before any other header), or in ansi_prefix.XXX.h (XXX ==
>mac on Mac OS, win32 on windows, etc.).

And according to the comment in <mslconfig> you have to rebuild the
C++ library if you toggle this switch. Pretty nasty surprise for
someone wanting to use pthreads on OS X. I looked through the
Targeting Mac OS document and the release notes and didn't see any
mention of any of this. Nor do I remember anything from the newsgroup
(just discussions about whether the allocators are thread safe which
they are because they call thru to BSD's malloc on Mach).

I'm not sure what the best way to handle this with boost is. Maybe
arrange for <ansi_prefix.mac.h> to be included and define
BOOST_HAS_THREADS if both _MWMT and __MACH__ are 1. People who don't
want to touch <ansi_prefix.mac.h> can still define _MWMT on the
command line. (BTW __MACH__ is documented, but in the Targeting Mac
OS help, not the Compiler help).

   -- Jesse


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk