File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -83,6 +83,23 @@ typedef __swiftc_intn_t(__INTPTR_WIDTH__) SwiftInt;
83
83
typedef __swiftc_uintn_t (__INTPTR_WIDTH__ ) SwiftUInt ;
84
84
#endif
85
85
86
+ #if __clang__
87
+ // Provide macros to temporarily suppress warning about the use of
88
+ // _Nullable and _Nonnull.
89
+ #define SWIFT_BEGIN_NULLABILITY_ANNOTATIONS \
90
+ _Pragma("clang diagnostic push") \
91
+ _Pragma("clang diagnostic ignored \"-Wnullability-extension\"") \
92
+ _Pragma("clang assume_nonnull begin")
93
+
94
+ #define SWIFT_END_NULLABILITY_ANNOTATIONS \
95
+ _Pragma("clang diagnostic pop") _Pragma("clang assume_nonnull end")
96
+ #else
97
+ #define SWIFT_BEGIN_NULLABILITY_ANNOTATIONS
98
+ #define SWIFT_END_NULLABILITY_ANNOTATIONS
99
+ #define _Nullable
100
+ #define _Nonnull
101
+ #endif
102
+
86
103
SWIFT_BEGIN_NULLABILITY_ANNOTATIONS
87
104
88
105
#ifdef __cplusplus
You can’t perform that action at this time.
0 commit comments