Skip to content

Commit ad99326

Browse files
authored
Merge pull request #6138 from hughbe/shims-msvc
Fix errors and warnings building swift/shims on Windows using MSVC
2 parents fe4bac5 + 60e1cd1 commit ad99326

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

stdlib/public/SwiftShims/LibcShims.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ namespace swift { extern "C" {
3535
// the current platform in the runtime code.
3636
#if defined(__linux__) && defined (__arm__) && !defined(__android__)
3737
typedef int __swift_ssize_t;
38-
#elif defined(_MSC_VER)
38+
#elif defined(_WIN32)
3939
#if defined(_M_ARM) || defined(_M_IX86)
4040
typedef int __swift_ssize_t;
4141
#elif defined(_M_X64)

stdlib/public/SwiftShims/Visibility.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,11 @@
1818
#ifndef SWIFT_STDLIB_SHIMS_VISIBILITY_H
1919
#define SWIFT_STDLIB_SHIMS_VISIBILITY_H
2020

21-
#if defined(__has_feature) && __has_feature(nullability)
21+
#if !defined(__has_feature)
22+
#define __has_feature(x) false
23+
#endif
24+
25+
#if __has_feature(nullability)
2226
// Provide macros to temporarily suppress warning about the use of
2327
// _Nullable and _Nonnull.
2428
# define SWIFT_BEGIN_NULLABILITY_ANNOTATIONS \

0 commit comments

Comments
 (0)