aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2017-12-23 14:31:46 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2017-12-23 14:31:46 +0200
commitab5180c94f87486072c451055cf289413596c22f (patch)
tree8b5159c770ea236cc6c2fc56c1e58d0add464fd8
parentee4683ff1332584283f7994365353f84b153d533 (diff)
Use BUILD2_ATOMIC_NON_LOCK_FREE macro to suppress non-lock-free errors
-rw-r--r--build2/target.hxx8
1 files changed, 7 insertions, 1 deletions
diff --git a/build2/target.hxx b/build2/target.hxx
index 10b0eb3..e15b970 100644
--- a/build2/target.hxx
+++ b/build2/target.hxx
@@ -1367,14 +1367,20 @@ namespace build2
static const target_type static_type;
protected:
+
+ // Complain if timestamp is not lock-free unless we were told non-lock-
+ // free is ok.
+ //
+#ifndef BUILD2_ATOMIC_NON_LOCK_FREE
// C++17:
//
// static_assert (atomic<timestamp::rep>::is_always_lock_free,
// "timestamp is not lock-free on this architecture");
-
+ //
#if !defined(ATOMIC_LLONG_LOCK_FREE) || ATOMIC_LLONG_LOCK_FREE != 2
# error timestamp is not lock-free on this architecture
#endif
+#endif
// Note that the value is not used to synchronize any other state so we
// use the release-consume ordering (i.e., we are only interested in the