// 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
extern "C" long __cdecl _InterlockedExchange( long volatile *, long );
extern "C" long __cdecl _InterlockedExchangeAdd( long volatile *, long );
+# if defined( BOOST_MSVC ) && BOOST_MSVC == 1310
+//From MSDN, Visual Studio .NET 2003 spedific: To declare one of the interlocked functions
+//for use as an intrinsic, the function must be declared with the leading underscore and
+//the new function must appear in a #pragma intrinsic statement.
+# pragma intrinsic( _InterlockedIncrement )
+# pragma intrinsic( _InterlockedDecrement )
+# pragma intrinsic( _InterlockedCompareExchange )
+# pragma intrinsic( _InterlockedExchange )
+# pragma intrinsic( _InterlockedExchangeAdd )
+# endif
+
#endif
# define BOOST_SP_INTERLOCKED_INCREMENT _InterlockedIncrement