diff --git a/include/boost/smart_ptr/detail/sp_interlocked.hpp b/include/boost/smart_ptr/detail/sp_interlocked.hpp index 79cae14..68ce292 100644 --- a/include/boost/smart_ptr/detail/sp_interlocked.hpp +++ b/include/boost/smart_ptr/detail/sp_interlocked.hpp @@ -32,6 +32,11 @@ // MinGW-w64 provides intrin.h for both 32 and 64-bit targets. # define BOOST_SP_HAS_INTRIN_H +#elif defined( __LP64__ ) + +// We have to use intrin.h on Cygwin 64 +# define BOOST_SP_HAS_INTRIN_H + // Intel C++ on Windows on VC10+ stdlib #elif defined( BOOST_INTEL_WIN ) && defined( _CPPLIB_VER ) && _CPPLIB_VER >= 520 diff --git a/test/sp_interlocked_test.cpp b/test/sp_interlocked_test.cpp index 1b075b4..73a57f6 100644 --- a/test/sp_interlocked_test.cpp +++ b/test/sp_interlocked_test.cpp @@ -13,9 +13,20 @@ #include #include +#ifndef __LP64__ + +typedef long long_type; + +#else + +// On Cygwin 64, long is 64 bit +typedef int long_type; + +#endif + int main() { - long x = 0, r; + long_type x = 0, r; r = BOOST_SP_INTERLOCKED_INCREMENT( &x );