File tree Expand file tree Collapse file tree 1 file changed +11
-8
lines changed Expand file tree Collapse file tree 1 file changed +11
-8
lines changed Original file line number Diff line number Diff line change 5
5
#include < set>
6
6
7
7
// FIXME swift-ci linux tests do not support std::span
8
- #ifndef __linux__
8
+ #if defined(__has_include) && __has_include(<span>)
9
9
#include < span>
10
- #endif // __linux__
10
+ #define SPAN_DEFINED 1
11
+ #else
12
+ #define SPAN_DEFINED 0
13
+ #endif
11
14
12
15
static const size_t spanSize = 50000 ;
13
16
14
17
using VectorOfU32 = std::vector<uint32_t >;
15
18
using SetOfU32 = std::set<uint32_t >;
16
- #ifndef __linux__
19
+ #if SPAN_DEFINED
17
20
using ArrayOfU32 = uint32_t [spanSize];
18
21
using SpanOfU32 = std::span<uint32_t >;
19
- #endif // __linux__
22
+ #endif
20
23
21
24
static inline VectorOfU32 vec;
22
25
static inline SetOfU32 set;
23
- #ifndef __linux__
26
+ #if SPAN_DEFINED
24
27
static inline ArrayOfU32 array;
25
28
static inline SpanOfU32 span;
26
- #endif // __linux__
29
+ #endif
27
30
28
31
inline void initVector (size_t size) {
29
32
if (!vec.empty ()) {
@@ -44,7 +47,7 @@ inline void initSet(size_t size) {
44
47
}
45
48
}
46
49
47
- #ifndef __linux__
50
+ #if SPAN_DEFINED
48
51
inline void initSpan () {
49
52
if (!span.empty ()) {
50
53
return ;
@@ -54,7 +57,7 @@ inline void initSpan() {
54
57
}
55
58
span = SpanOfU32 (array);
56
59
}
57
- #endif // __linux__
60
+ #endif
58
61
59
62
inline VectorOfU32 makeVector32 (size_t size) {
60
63
initVector (size);
You can’t perform that action at this time.
0 commit comments