Skip to content

Commit 532c006

Browse files
authored
Merge pull request #20707 from compnerd/import-bridging-header
2 parents e10363f + 052c89d commit 532c006

File tree

3 files changed

+20
-1
lines changed

3 files changed

+20
-1
lines changed

lib/ClangImporter/ClangImporter.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1352,7 +1352,12 @@ bool ClangImporter::importBridgingHeader(StringRef header, ModuleDecl *adapter,
13521352
return true;
13531353
}
13541354

1355-
llvm::SmallString<128> importLine{"#import \""};
1355+
llvm::SmallString<128> importLine;
1356+
if (Impl.SwiftContext.LangOpts.EnableObjCInterop)
1357+
importLine = "#import \"";
1358+
else
1359+
importLine = "#include \"";
1360+
13561361
importLine += header;
13571362
importLine += "\"\n";
13581363

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
2+
#ifndef app_bridging_header_to_pch_h
3+
#define app_bridging_header_to_pch_h
4+
15
static inline int app_function(int x) {
26
return x + 27;
37
}
8+
9+
#endif
10+
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
1+
2+
#ifndef chained_unit_test_bridging_header_to_pch_h
3+
#define chained_unit_test_bridging_header_to_pch_h
4+
15
#include "app-bridging-header-to-pch.h"
26

37
static inline int unit_test_function(int x) {
48
return x + 28;
59
}
10+
11+
#endif
12+

0 commit comments

Comments
 (0)