diff options
author | Jonathan Wakely <jwakely@redhat.com> | 2016-12-08 12:08:14 +0000 |
---|---|---|
committer | Jonathan Wakely <redi@gcc.gnu.org> | 2016-12-08 12:08:14 +0000 |
commit | eae0b895e0f4dce0601e27cc7c54c89be3c480b9 (patch) | |
tree | 332cd6649ed19bd9f26c4dc860b47ab03c916a14 /libstdc++-v3/include | |
parent | 66110738f0003a5434ffbd7e18a54ea898981efc (diff) | |
download | gcc-eae0b895e0f4dce0601e27cc7c54c89be3c480b9.tar.gz |
PR71856 try to fix Parallel Mode assertions again
PR libstdc++/71856
* doc/xml/manual/using.xml: Document macro.
* include/bits/c++config [_GLIBCXX_DEBUG || _GLIBCXX_PARALLEL]
(__glibcxx_assert): Rename to __glibcxx_assert_impl.
[_GLIBCXX_DEBUG] (__glibcxx_assert): Expand to __glibcxx_assert_impl.
* include/parallel/base.h [_GLIBCXX_PARALLEL_ASSERTIONS]
(_GLIBCXX_PARALLEL_ASSERT): Expand to __glibcxx_assert_impl.
[!_GLIBCXX_PARALLEL_ASSERTIONS] (_GLIBCXX_PARALLEL_ASSERT): Define as
empty.
* testsuite/25_algorithms/headers/algorithm/
parallel_algorithm_assert2.cc: New test.
From-SVN: r243434
Diffstat (limited to 'libstdc++-v3/include')
-rw-r--r-- | libstdc++-v3/include/bits/c++config | 13 | ||||
-rw-r--r-- | libstdc++-v3/include/parallel/base.h | 6 |
2 files changed, 14 insertions, 5 deletions
diff --git a/libstdc++-v3/include/bits/c++config b/libstdc++-v3/include/bits/c++config index 8a27d14f951..39e55f42b54 100644 --- a/libstdc++-v3/include/bits/c++config +++ b/libstdc++-v3/include/bits/c++config @@ -434,9 +434,8 @@ namespace std #endif // Assert. -#if !defined(_GLIBCXX_ASSERTIONS) && !defined(_GLIBCXX_PARALLEL) -# define __glibcxx_assert(_Condition) -#else +#if defined(_GLIBCXX_ASSERTIONS) \ + || defined(_GLIBCXX_PARALLEL) || defined(_GLIBCXX_PARALLEL_ASSERTIONS) namespace std { // Avoid the use of assert, because we're trying to keep the <cassert> @@ -450,7 +449,7 @@ namespace std __builtin_abort(); } } -#define __glibcxx_assert(_Condition) \ +#define __glibcxx_assert_impl(_Condition) \ do \ { \ if (! (_Condition)) \ @@ -459,6 +458,12 @@ namespace std } while (false) #endif +#if defined(_GLIBCXX_ASSERTIONS) +# define __glibcxx_assert(_Condition) __glibcxx_assert_impl(_Condition) +#else +# define __glibcxx_assert(_Condition) +#endif + // Macros for race detectors. // _GLIBCXX_SYNCHRONIZATION_HAPPENS_BEFORE(A) and // _GLIBCXX_SYNCHRONIZATION_HAPPENS_AFTER(A) should be used to explain diff --git a/libstdc++-v3/include/parallel/base.h b/libstdc++-v3/include/parallel/base.h index 7d4b69e7113..721c42d2591 100644 --- a/libstdc++-v3/include/parallel/base.h +++ b/libstdc++-v3/include/parallel/base.h @@ -419,7 +419,11 @@ namespace __gnu_parallel } } -#define _GLIBCXX_PARALLEL_ASSERT(_Condition) __glibcxx_assert(_Condition) +#if _GLIBCXX_PARALLEL_ASSERTIONS && defined(__glibcxx_assert_impl) +#define _GLIBCXX_PARALLEL_ASSERT(_Condition) __glibcxx_assert_impl(_Condition) +#else +#define _GLIBCXX_PARALLEL_ASSERT(_Condition) +#endif } //namespace __gnu_parallel |