Skip to content

Commit 21d5a7d

Browse files
committed
Revert "[cxx-interop] Fix check to include std::span"
This reverts commit 2b90ea3.
1 parent 75f00fe commit 21d5a7d

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

benchmark/utils/CxxTests/CxxStdlibPerformance.h

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,25 +5,28 @@
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

1215
static const size_t spanSize = 50000;
1316

1417
using VectorOfU32 = std::vector<uint32_t>;
1518
using SetOfU32 = std::set<uint32_t>;
16-
#ifndef __linux__
19+
#if SPAN_DEFINED
1720
using ArrayOfU32 = uint32_t[spanSize];
1821
using SpanOfU32 = std::span<uint32_t>;
19-
#endif // __linux__
22+
#endif
2023

2124
static inline VectorOfU32 vec;
2225
static inline SetOfU32 set;
23-
#ifndef __linux__
26+
#if SPAN_DEFINED
2427
static inline ArrayOfU32 array;
2528
static inline SpanOfU32 span;
26-
#endif // __linux__
29+
#endif
2730

2831
inline 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
4851
inline 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

5962
inline VectorOfU32 makeVector32(size_t size) {
6063
initVector(size);

0 commit comments

Comments
 (0)