Skip to content

Commit 3f18cea

Browse files
committed
Guard uses of ObjC in objc_implementation.h
Helps allow test/decl/ext/cdecl_implementation.swift to run on non-ObjC platforms.
1 parent 5d4bb2b commit 3f18cea

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

test/decl/ext/Inputs/objc_implementation.h

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#if __OBJC__
2+
13
@import Foundation;
24

35
@interface ObjCBaseClass
@@ -186,11 +188,18 @@
186188

187189
@end
188190

191+
@protocol EmptyObjCProto
192+
@end
193+
194+
#endif
195+
189196
void CImplFunc1(int param);
190197
void CImplFunc2(int param);
191198

192199
void CImplFuncMismatch1(int param);
193200
void CImplFuncMismatch2(int param);
201+
202+
#if __OBJC__
194203
void CImplFuncMismatch3(_Nullable id param);
195204
void CImplFuncMismatch4(_Nullable id param);
196205
void CImplFuncMismatch5(_Nonnull id param);
@@ -199,6 +208,8 @@ _Nullable id CImplFuncMismatch3a(int param);
199208
_Nullable id CImplFuncMismatch4a(int param);
200209
_Nonnull id CImplFuncMismatch5a(int param);
201210
_Nonnull id CImplFuncMismatch6a(int param);
211+
#endif
212+
202213
void CImplFuncNameMismatch1(int param);
203214
void CImplFuncNameMismatch2(int param);
204215

@@ -212,6 +223,3 @@ void CImplStructStaticFunc1(int param) __attribute__((swift_name("CImplStruct.st
212223
struct ObjCStruct {
213224
int foo;
214225
};
215-
216-
@protocol EmptyObjCProto
217-
@end

0 commit comments

Comments
 (0)