Fix sp_interlocked on Cygwin 64

This commit is contained in:
Peter Dimov
2018-03-08 05:15:49 +02:00
parent c3b3835a58
commit f16fbdce26
2 changed files with 17 additions and 1 deletions

View File

@ -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

View File

@ -13,9 +13,20 @@
#include <boost/smart_ptr/detail/sp_interlocked.hpp>
#include <boost/detail/lightweight_test.hpp>
#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 );