From ab5180c94f87486072c451055cf289413596c22f Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sat, 23 Dec 2017 14:31:46 +0200 Subject: Use BUILD2_ATOMIC_NON_LOCK_FREE macro to suppress non-lock-free errors --- build2/target.hxx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'build2/target.hxx') 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::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 -- cgit v1.1