Opened 9 years ago
Closed 9 years ago
#9174 closed Bugs (fixed)
Incompatible declaration in interlocked.hpp
Reported by: | Owned by: | Peter Dimov | |
---|---|---|---|
Milestone: | To Be Determined | Component: | smart_ptr |
Version: | Boost 1.54.0 | Severity: | Problem |
Keywords: | interlocked _InterlockedCompareExchange _InterlockedExchangeAdd | Cc: |
Description
If I compile boost\detail\interlocked.hpp on MS Visual Studio 2010 using Intel Compiler 14.0 and my project also includes msvc's <intrin.h>, then I get a compiler error of incompatible declarations, because <intrin.h> declares _InterlockedCompareExchange
, _InterlockedExchange
and _InterlockedExchangeAdd
without __cdecl
but interlocked.hpp declares them as __cdecl
. The issue is solved by stripping __CLRCALL_PURE_OR_CDECL
from declarations of these three functions. (And maybe better include the standard <intrin.h> when compiling on MSVC even with Intel compiler)
Change History (5)
comment:1 by , 9 years ago
comment:2 by , 9 years ago
Component: | thread → smart_ptr |
---|---|
Owner: | changed from | to
comment:3 by , 9 years ago
It is not possible to determine whether Intel has <intrin.h> as this depends on the underlying MSVC installation, but I've added in [85994] support for #define BOOST_USE_INTRIN_H, which forces interlocked.hpp to unconditionally use intrin.h. This should help in cases where the autodetection is not quite up to par.
comment:4 by , 9 years ago
comment:5 by , 9 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Is this a duplicate of #8485?