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 55#include < set>
66
77// FIXME swift-ci linux tests do not support std::span
8- #ifndef __linux__
8+ #if defined(__has_include) && __has_include(<span>)
99#include < span>
10- #endif // __linux__
10+ #define SPAN_DEFINED 1
11+ #else
12+ #define SPAN_DEFINED 0
13+ #endif
1114
1215static const size_t spanSize = 50000 ;
1316
1417using VectorOfU32 = std::vector<uint32_t >;
1518using SetOfU32 = std::set<uint32_t >;
16- #ifndef __linux__
19+ #if SPAN_DEFINED
1720using ArrayOfU32 = uint32_t [spanSize];
1821using SpanOfU32 = std::span<uint32_t >;
19- #endif // __linux__
22+ #endif
2023
2124static inline VectorOfU32 vec;
2225static inline SetOfU32 set;
23- #ifndef __linux__
26+ #if SPAN_DEFINED
2427static inline ArrayOfU32 array;
2528static inline SpanOfU32 span;
26- #endif // __linux__
29+ #endif
2730
2831inline void initVector (size_t size) {
2932 if (!vec.empty ()) {
@@ -44,7 +47,7 @@ inline void initSet(size_t size) {
4447 }
4548}
4649
47- #ifndef __linux__
50+ #if SPAN_DEFINED
4851inline void initSpan () {
4952 if (!span.empty ()) {
5053 return ;
@@ -54,7 +57,7 @@ inline void initSpan() {
5457 }
5558 span = SpanOfU32 (array);
5659}
57- #endif // __linux__
60+ #endif
5861
5962inline VectorOfU32 makeVector32 (size_t size) {
6063 initVector (size);
You can’t perform that action at this time.
0 commit comments