Skip to content

Commit 4501298

Browse files
authored
Fix build failure with Xcode 14.3 release candidate. (#905)
The Xcode 14.3 release candidate is available (https://developer.apple.com/documentation/xcode-release-notes/xcode-14_3-release-notes) It requires the following changes to build Alive2.
1 parent a193673 commit 4501298

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

util/spaceship.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,18 @@
33
// Copyright (c) 2018-present The Alive2 Authors.
44
// Distributed under the MIT license that can be found in the LICENSE file.
55

6-
#if defined(__clang__) && __clang_major__ < 15 && defined(__APPLE__)
6+
#if defined(__clang__) && defined(__APPLE__)
77

88
#include <compare>
99

10+
#if (__clang_major__ < 14 || (__clang_major__ == 14 && __clang_patchlevel__ == 0))
11+
1012
namespace std {
1113
inline bool is_neq(std::weak_ordering o) { return o != 0; }
1214
}
1315

16+
#endif
17+
1418
namespace {
1519

1620
inline
@@ -41,6 +45,7 @@ std::weak_ordering operator<=>(const std::map<K,V> &lhs,
4145
return compare_iterators(lhs.begin(), lhs.end(), rhs.begin(), rhs.end());
4246
}
4347

48+
#if (__clang_major__ < 14 || (__clang_major__ == 14 && __clang_patchlevel__ == 0))
4449
template <typename X, typename Y>
4550
std::weak_ordering operator<=>(const std::pair<X,Y> &lhs,
4651
const std::pair<X,Y> &rhs) {
@@ -49,6 +54,7 @@ std::weak_ordering operator<=>(const std::pair<X,Y> &lhs,
4954
return cmp;
5055
return lhs.second <=> rhs.second;
5156
}
57+
#endif
5258

5359
template <typename T>
5460
std::weak_ordering compare_iterators(T &&I, const T &E, T &&II, const T &EE) {

0 commit comments

Comments
 (0)