Revert "[cxx-interop] Fix check to include std::span"

This reverts commit 2b90ea3bda.
This commit is contained in:
Artem Chikin
2024-09-10 10:18:29 -07:00
parent 75f00fe345
commit 21d5a7dfda

View File

@@ -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);