Commit Graph

28 Commits

Author SHA1 Message Date
Andrey Semashev
65b9c99a67 Add explicit type casts for arguments of Interlocked* intrinsics.
This allows to use any compatible types with INTERLOCKED_* macros, not just
the ones strictly matching the particular implementation of the intrinsics.

In particular, this fixes compilation for Cygwin64, which is an LP64 target,
meaning that long is 64-bit and _Interlocked* intrinsics use a different
integer type for its 32-bit integer arguments.

Additionally, enable use of intrin.h on Cygwin (32-bit).

The test has been updated to explicitly use 32-bit integer arguments.
2019-07-10 14:44:13 +03:00
Andrey Semashev
bb91190323 Disable _Interlocked*Pointer intrinsics on x86 for MSVC-12 and below.
There is a macro conflict for _InterlockedExchangePointer between intrin.h from
MSVC-12 and winnt.h from Windows SDK 8.1, which causes compilation failures.
2019-07-10 01:06:34 +03:00
Andrey Semashev
bfb9932296 Use interlocked intrinsics for pointers more universally on more recent MSVC.
_Interlocked*Pointer intrinsics are defined for all target architectures on
MSVC-12 and later. On MSVC-11 they are also defined for ARM.
2019-05-31 18:24:35 +03:00
Andrey Semashev
52b44afc06 Use _Interlocked*Pointer intrinsics on ARM64 targets.
Fixes https://github.com/boostorg/winapi/issues/76.
Closes https://github.com/boostorg/winapi/pull/77.

Also, use consistent call convention attribute across _Interlocked*
intrinsics when they are declared in the header.
2019-05-31 17:32:57 +03:00
Andrey Semashev
cb0f6ed2a5 Removed volatile qualifiers for WinCE older than 6.0. 2018-08-13 20:05:34 +03:00
Andrey Semashev
bf9dfd9f21 Added support for clang-cl, improved support for WinCE and MSVC 8 and 9.
This commit incorporates some of the changes made to
boost/smart_ptr/detail/sp_interlocked.hpp by Peter Dimov, namely:

- Define an internal config macro BOOST_INTERLOCKED_HAS_INTRIN_H when
  the compiler is known to have a useful intrin.h header.
- Use this macro to select the common implementation based on intrin.h.
- Removed MinGW-w64 branch of implementation as it is now covered by
  the common branch based on intrin.h.
- Added detection of clang-cl, a new MSVC pretender. The compiler is
  assumed to have support for intrin.h.
- Added a separate branch for Windows CE >=6, with differently named
  interlocked functions. No way to test this and no idea if this is
  correct.
- For MSVC 8 and 9 don't use intrin.h as it reportedly conflicts
  with <utility>. On these compilers we will declare the intrinsics
  ourselves.
2018-08-13 18:44:29 +03:00
Andrey Semashev
799be2a866 Removed the special code for Windows CE 6.0.
Reportedly, that code branch was not working an caused linking errors. As
reported in https://svn.boost.org/trac10/ticket/5431, Windows CE SDK still
provides Interlocked function definitions, but with slightly different
signatures. This PR keeps a single code branch for Windows CE that matches
the declarations described in the ticket. Untested.

This change is based on https://github.com/boostorg/winapi/pull/58
by James E. King, III <jking@apache.org>.

Fixes https://svn.boost.org/trac10/ticket/5431.
2017-09-24 02:36:37 +03:00
Andrey Semashev
e7c3a828a9 Use intrin.h for MSVC 8. Restore #pragma intrinsic for MSVC 7.1.
Also removed some code duplication.
2014-08-23 19:19:22 +04:00
Peter Dimov
8587d8cda6 Merged revision(s) 85994 from trunk: Add BOOST_USE_INTRIN_H support; remove #pragma intrinsic, not needed and not supported on Intel. Refs #6646. Refs #7318. Refs #9174.
[SVN r86416]
2014-06-09 20:46:33 +04:00
Andrey Semashev
567d9a5a11 Merged latest changes from trunk.
[SVN r85988]
2014-06-09 20:46:33 +04:00
Peter Dimov
3a0381e73e Merged revision(s) [80935] from trunk: Fix the _WIN32_WCE >= 0x600 case.
[SVN r80960]
2014-06-09 20:46:33 +04:00
Vicente J. Botet Escriba
0ddb49b7d4 Thread: Updated from trunk 1.52
[SVN r80473]
2014-06-09 20:46:33 +04:00
Peter Dimov
b17e65edbe Merge [75396] to release. Fixes #4678.
[SVN r75757]
2014-06-09 20:46:33 +04:00
Anthony Williams
5efc0d5191 Merged fix for issue #4849 from trunk (fix boost.thread on mingw64) (authorized by rene)
[SVN r72657]
2014-06-09 20:46:33 +04:00
Peter Dimov
f2784b098c Merge [57958] to release. Fixes #3378.
[SVN r58069]
2014-06-09 20:46:33 +04:00
Peter Dimov
195cd84e7b Merged 43316, 43317, 43318, 43733, 43782, 43873, 43888, 43916, 43950, 44055, 44056, 44058, 44073, 44074, 44132, 44137, 44138, 44140, 44344 from trunk to release
[SVN r47339]
2014-06-09 20:46:33 +04:00
Beman Dawes
4faebf3eaa config, detail, filesystem, system, tools, at 41278.
[SVN r41316]
2014-06-09 20:46:33 +04:00
Peter Dimov
ea6ee9bd6f Windows CE patch by Michael Fink
[SVN r33986]
2014-06-09 20:46:33 +04:00
Anthony Williams
1202be7810 Win32 implementation of boost::timed_mutex
[SVN r33272]
2014-06-09 20:46:33 +04:00
Anthony Williams
23f349906e Moved BOOST_INTERLOCKED_READ stuff into its own header
[SVN r31098]
2014-06-09 20:46:33 +04:00
Anthony Williams
e46b817b2d Removed :: qualification on _Interlocked functions
[SVN r31097]
2014-06-09 20:46:32 +04:00
Anthony Williams
0a9c3b04f2 Added BOOST_INTERLOCKED_EXCHANGE_POINTER in all branches of the #if
[SVN r31012]
2014-06-09 20:46:32 +04:00
Anthony Williams
452aebbef5 Added InterlockedExchangePointer
[SVN r31010]
2014-06-09 20:46:32 +04:00
Anthony Williams
6c0287959f InterlockedCompareExchangePointer is only intrinsic on 64 bit platforms, otherwise it's just a synonym for InterlockedCompareExchange
[SVN r30951]
2014-06-09 20:46:32 +04:00
Anthony Williams
096ecd3ec3 Added interlocked compare/exchange for pointers, and interlocked_read for values and pointers
[SVN r30941]
2014-06-09 20:46:32 +04:00
Anthony Williams
86c50368d3 New version of call_once for win32
[SVN r30847]
2014-06-09 20:46:32 +04:00
Peter Dimov
73c5a1f285 <intrin.h> appears broken.
[SVN r27737]
2014-06-09 20:46:32 +04:00
Peter Dimov
7fccf74af7 Split sp_counted_base into no threads (nt), win32 lock-free (w32) and pthreads (pt)
[SVN r27729]
2014-06-09 20:46:32 +04:00