forked from boostorg/smart_ptr
Fix sp_interlocked on Cygwin 64
This commit is contained in:
@@ -32,6 +32,11 @@
|
|||||||
// MinGW-w64 provides intrin.h for both 32 and 64-bit targets.
|
// MinGW-w64 provides intrin.h for both 32 and 64-bit targets.
|
||||||
# define BOOST_SP_HAS_INTRIN_H
|
# 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
|
// Intel C++ on Windows on VC10+ stdlib
|
||||||
#elif defined( BOOST_INTEL_WIN ) && defined( _CPPLIB_VER ) && _CPPLIB_VER >= 520
|
#elif defined( BOOST_INTEL_WIN ) && defined( _CPPLIB_VER ) && _CPPLIB_VER >= 520
|
||||||
|
|
||||||
|
@@ -13,9 +13,20 @@
|
|||||||
#include <boost/smart_ptr/detail/sp_interlocked.hpp>
|
#include <boost/smart_ptr/detail/sp_interlocked.hpp>
|
||||||
#include <boost/detail/lightweight_test.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()
|
int main()
|
||||||
{
|
{
|
||||||
long x = 0, r;
|
long_type x = 0, r;
|
||||||
|
|
||||||
r = BOOST_SP_INTERLOCKED_INCREMENT( &x );
|
r = BOOST_SP_INTERLOCKED_INCREMENT( &x );
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user