Boost logo

Threads-Devel :

From: Jeroen van der Wulp (J.v.d.Wulp_at_[hidden])
Date: 2007-10-16 08:28:27


Hello,

I have been using the thread library in boost for a while now as a
superior alternative to the threading functionality offered in wxWidgets
itself. I'm closely following the recent activity on the development of
the boost thread library. I'm importing changes as they are comitted and
so far everything worked.

It turns out that on some platforms/configurations conflicts arise
between wxWidgets and Boost thread. The problem is that wxWidgets
defines a macro '_' and some methods definitions in
boost/thread/pthread/mutex.hpp (lines 162, 173, 181, 193) are either
called _, or they use a similar macro that does not get defined because
the wxWidgets variant is defined. To get an impression:

boost/thread/pthread/mutex.hpp:162:1: error: pasting "L" and "&" does
not give a valid preprocessing token
boost/thread/pthread/mutex.hpp:173:1: error: pasting "L" and "&" does
not give a valid preprocessing token
boost/thread/pthread/mutex.hpp:181:1: error: pasting "L" and "&" does
not give a valid preprocessing token
boost/thread/pthread/mutex.hpp:193:1: error: pasting "L" and "&" does
not give a valid preprocessing token
boost/thread/pthread/mutex.hpp: In member function 'void
boost::timed_mutex::lock()':
boost/thread/pthread/mutex.hpp:162: error: 'L' was not declared in this
scope
boost/thread/pthread/mutex.hpp: In member function 'void
boost::timed_mutex::unlock()':
boost/thread/pthread/mutex.hpp:173: error: 'L' was not declared in this
scope
boost/thread/pthread/mutex.hpp: In member function 'bool
boost::timed_mutex::try_lock()':
/usr/locboost/thread/pthread/mutex.hpp:181: error: 'L' was not declared
in this scope
boost/thread/pthread/mutex.hpp: In member function 'bool
boost::timed_mutex::timed_lock(const boost::system_time&)':
boost/thread/pthread/mutex.hpp:193: error: 'L' was not declared in this
scope

The problem can be solved by reordering include statements in
applications that use both Boost thread and wxWidgets. However I was
wondering whether it would be possible to prevent this conflict
altogether by renaming the methods in mutex.hpp to something else.

Thanks,

Jeroen van der Wulp


Threads-Devel list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk