Boost logo

Boost :

Subject: Re: [boost] [Boost-users] cross-compilation x86_64-w64-ming32: undefined reference to `InterlockedIncrement'
From: Andrey Semashev (andrey.semashev_at_[hidden])
Date: 2013-09-23 09:30:22


On Mon, Sep 23, 2013 at 4:02 PM, Peter Dimov <lists_at_[hidden]> wrote:

> Andrey Semashev wrote:
>
>> Also, intrin.h is an MSVC-specific header and I'm not sure it's portable
>> across different versions of MinGW.
>>
>
> <intrin.h> in this context probably includes the MingW64 header of that
> name.
>

I understand.

> In the long term it might be worthwhile to use gcc atomic intrinsics to
>> implement BOOST_INTERLOCKED* macros.
>>
>
> BOOST_INTERLOCKED_* are not supposed to be implemented. If Boost.Thread
> uses them instead of the appropriate gcc atomics, this is a problem in
> Boost.Thread, not in interlocked.hpp.
>

The macros are supposed to provide low level atomic ops on Windows, aren't
they? Wouldn't it be better to use gcc atomic intrinsics instead of WinAPI
calls in case of MinGW?

I'm not disputing now whether Boost.Thread should be based on Boost.Atomic,
or whatever other abstraction layer.


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