id summary reporter owner description type status milestone component version severity resolution keywords cc 6325 InterlockedExchangeAdd improperly identified as managed code. filmorependrgn@… chris_kohlhoff "There is a Microsoft C++ bug that causes InterlockedExchangeAdd to improperly be identified as managed code instead of native code. A workaround is mentioned here: http://connect.microsoft.com/VisualStudio/feedback/details/629931/internal-compiler-error-c1001-when-compiling-opencv-2-1-2-2-with-c-cli-64-bit This prevents programs from being compiled correctly in VS2010 The workaround is implemented below: boost\asio\detail\win_thread.hpp:45 {{{ return (1?::InterlockedExchangeAdd(&terminate_threads_, 0) != 0: 0!= InterlockedExchangeAdd64((volatile LONG64 *)0,(LONG64) 0)); }}} and boost\asio\detail\impl\winsock_init.ipp:54 {{{ long result = (1?::InterlockedExchangeAdd(&d.result_, 0) : InterlockedExchangeAdd64((volatile LONG64 *)0,(LONG64) 0)); }}} Implementing the above fix allows the programs to compile with a warning: {{{ warning C4793: 'boost::asio::detail::win_thread_base::terminate_threads' : function compiled as native : 1> Found an intrinsic not supported in managed code }}} and {{{ warning C4793: 'boost::asio::detail::winsock_init_base::throw_on_error' : function compiled as native : 1> Found an intrinsic not supported in managed code }}} This is a workaround for a compiler bug, so I don't know how the boost development team wants to treat this. Using VS2010 compiling for a 64-bit target (amd64)" Support Requests new To Be Determined asio Boost 1.48.0 Problem InterlockedExchangeAdd