mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Revert "[cxx-interop] Fix check to include std::span"
This reverts commit 2b90ea3bda.
This commit is contained in:
@@ -5,25 +5,28 @@
|
||||
#include <set>
|
||||
|
||||
// FIXME swift-ci linux tests do not support std::span
|
||||
#ifndef __linux__
|
||||
#if defined(__has_include) && __has_include(<span>)
|
||||
#include <span>
|
||||
#endif // __linux__
|
||||
#define SPAN_DEFINED 1
|
||||
#else
|
||||
#define SPAN_DEFINED 0
|
||||
#endif
|
||||
|
||||
static const size_t spanSize = 50000;
|
||||
|
||||
using VectorOfU32 = std::vector<uint32_t>;
|
||||
using SetOfU32 = std::set<uint32_t>;
|
||||
#ifndef __linux__
|
||||
#if SPAN_DEFINED
|
||||
using ArrayOfU32 = uint32_t[spanSize];
|
||||
using SpanOfU32 = std::span<uint32_t>;
|
||||
#endif // __linux__
|
||||
#endif
|
||||
|
||||
static inline VectorOfU32 vec;
|
||||
static inline SetOfU32 set;
|
||||
#ifndef __linux__
|
||||
#if SPAN_DEFINED
|
||||
static inline ArrayOfU32 array;
|
||||
static inline SpanOfU32 span;
|
||||
#endif // __linux__
|
||||
#endif
|
||||
|
||||
inline void initVector(size_t size) {
|
||||
if (!vec.empty()) {
|
||||
@@ -44,7 +47,7 @@ inline void initSet(size_t size) {
|
||||
}
|
||||
}
|
||||
|
||||
#ifndef __linux__
|
||||
#if SPAN_DEFINED
|
||||
inline void initSpan() {
|
||||
if (!span.empty()) {
|
||||
return;
|
||||
@@ -54,7 +57,7 @@ inline void initSpan() {
|
||||
}
|
||||
span = SpanOfU32(array);
|
||||
}
|
||||
#endif // __linux__
|
||||
#endif
|
||||
|
||||
inline VectorOfU32 makeVector32(size_t size) {
|
||||
initVector(size);
|
||||
|
||||
Reference in New Issue
Block a user