
I would like to use Boost.Thread in my 'winelib' application (a Linux executable that can also use Windows APIs via Wine). My application hosts, and shares threads with, 3rd party Windows DLL binaries. I've been told that to interact well those threads I must use the Windows threading APIs in my application. But by default Boost for Fedora (naturally) uses the pthread APIs.
So I would need to use the Win32 variant of Boost.Thread. Any suggestions for how to use the Win32 thread APIs in Boost.Thread, but use the Linux variants of the rest of the libraries like Boost.Filesystem etc?
First off, put threadapi=win32 on your bjam command line. This will ensure the libraries are named differently to the pthread ones, and won't define the macros that force pthreads. Next, ensure that _WIN32 is defined (e.g. add -D_WIN32 to <compileflags> for your compiler in user-config.jam) I wouldn't recommend trying to use some pthreads and some win32 builds of boost libs in the same app: if they use any boost.thread facilities then the definitions are different between the two APIs (e.g. structure of boost::mutex). If winegcc acts like gcc, try a line like this in your user-config.jam: using gcc : wine : /path/to/winegcc : <compile-flags>-D_WIN32 ; Anthony -- Anthony Williams | Just Software Solutions Ltd Custom Software Development | http://www.justsoftwaresolutions.co.uk Registered in England, Company Number 5478976. Registered Office: 15 Carrallack Mews, St Just, Cornwall, TR19 7UL