Skip to content

Commit 8981535

Browse files
add missing symbols to compatibility-symbols (#64510)
rdar://104389344
1 parent b27d02c commit 8981535

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

include/swift/PrintAsClang/ClangMacros.def

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,8 @@
7373
#endif
7474

7575
CLANG_MACRO_DEFINED("SWIFT_TYPEDEFS")
76+
CLANG_MACRO_DEFINED("char16_t")
77+
CLANG_MACRO_DEFINED("char32_t")
7678

7779
#define MAP_SIMD_TYPE(C_TYPE, SCALAR_TYPE, _) \
7880
CLANG_MACRO_DEFINED("swift_" #C_TYPE "2") \
@@ -185,6 +187,7 @@ CLANG_MACRO_BODY("SWIFT_ENUM", \
185187
"# define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) " \
186188
"SWIFT_ENUM(_type, _name, _extensibility)\n" \
187189
"# endif")
190+
CLANG_MACRO_DEFINED("SWIFT_ENUM_NAMED")
188191

189192
CLANG_MACRO("SWIFT_UNAVAILABLE", , "__attribute__((unavailable))")
190193
CLANG_MACRO("SWIFT_UNAVAILABLE_MSG", "(msg)", "__attribute__((unavailable(msg)))")
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// RUN: %empty-directory(%t)
2+
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) %S/../Inputs/empty.swift -typecheck -emit-objc-header-path %t/empty.h
3+
// RUN: %clang -extract-api -o %t/empty.symbols.json --target=%target-triple -isysroot %clang-importer-sdk-path -F %clang-importer-sdk-path/frameworks --extract-api-ignores=%swift_obj_root/share/swift/compatibility-symbols -fmodules -x objective-c-header %t/empty.h
4+
// RUN: %FileCheck %s --input-file %t/empty.symbols.json
5+
6+
// REQUIRES: objc_interop
7+
8+
// Make sure that any macros or typedefs added to the Clang compatibility header are reflected in
9+
// the `comptibility-symbols` file that is installed in the toolchain.
10+
11+
// CHECK: "symbols": []

0 commit comments

Comments
 (0)