We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents a6bc2b6 + 7bb6185 commit 63f761dCopy full SHA for 63f761d
stdlib/public/SwiftShims/SwiftStddef.h
@@ -29,11 +29,18 @@ typedef __SIZE_TYPE__ __swift_size_t;
29
#endif
30
31
// This selects the signed equivalent of the unsigned type chosen for size_t.
32
+#if __STDC_VERSION__-0 >= 201112l
33
typedef __typeof__(_Generic((__swift_size_t)0, \
34
unsigned long long int : (long long int)0, \
35
unsigned long int : (long int)0, \
36
unsigned int : (int)0, \
37
unsigned short : (short)0, \
38
unsigned char : (signed char)0)) __swift_ssize_t;
39
+#elif defined(__cplusplus)
40
+#include <type_traits>
41
+using __swift_ssize_t = std::make_signed<__swift_size_t>::type;
42
+#else
43
+#error "do not have __swift_ssize_t defined"
44
+#endif
45
46
#endif // SWIFT_STDLIB_SHIMS_SWIFT_STDDEF_H
0 commit comments