Skip to content

Commit 6ba58f5

Browse files
committed
add cross platform counted_by defines in test case
1 parent 2e81879 commit 6ba58f5

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

test/Interop/Cxx/stdlib/Inputs/std-span.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,14 @@
66
#include <string>
77
#include <vector>
88

9+
#ifndef __counted_by // cstddef already imports ptrcheck.h on apple platforms
10+
#if defined(__has_feature) && __has_feature(bounds_safety_attributes)
11+
#define __counted_by(x) __attribute__((__counted_by__(x)))
12+
#else
13+
#define __counted_by(x)
14+
#endif
15+
#endif
16+
917
using ConstSpanOfInt = std::span<const int>;
1018
using SpanOfInt = std::span<int>;
1119
using ConstSpanOfString = std::span<const std::string>;

0 commit comments

Comments
 (0)