2
0
mirror of https://github.com/boostorg/atomic.git synced 2026-02-02 20:32:09 +00:00

Use #pragma intrinsic only with MSVC.

This commit is contained in:
Andrey Semashev
2014-08-30 14:09:18 +04:00
parent 7f17e3b9a3
commit 8f10f20359

View File

@@ -18,8 +18,10 @@
#if defined(_MSC_VER) && (defined(_M_AMD64) || defined(_M_IX86))
extern "C" void _mm_pause(void);
#if defined(BOOST_MSVC)
#pragma intrinsic(_mm_pause)
#endif
#endif
namespace boost {
namespace atomics {
@@ -29,10 +31,8 @@ BOOST_FORCEINLINE void pause() BOOST_NOEXCEPT
{
#if defined(_MSC_VER) && (defined(_M_AMD64) || defined(_M_IX86))
_mm_pause();
#elif defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__))
__asm__ __volatile__("pause;");
#endif
}