mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
AST: Support @cdecl enums without an explicit C name
Accept `@cdecl` enums without an explicit C name. The C name defaults to the Swift one. It is printed using the `SWIFT_ENUM` macro instead of `SWIFT_ENUM_NAMED`.
This commit is contained in:
@@ -28,7 +28,7 @@
|
||||
// CHECK: #endif
|
||||
|
||||
// CHECK: /// Enums
|
||||
// CHECK: typedef SWIFT_ENUM_NAMED(int, CEnum, "CEnum", closed) {
|
||||
// CHECK: typedef SWIFT_ENUM(int, CEnum, closed) {
|
||||
// CHECK: CEnumA = 0,
|
||||
// CHECK: CEnumB = 1,
|
||||
// CHECK: };
|
||||
@@ -84,7 +84,7 @@ func g_nullablePointers(_ x: UnsafeMutableRawPointer,
|
||||
|
||||
/// Enums
|
||||
|
||||
@cdecl("CEnum")
|
||||
@cdecl
|
||||
enum CEnum: CInt { case A, B }
|
||||
|
||||
@cdecl("CEnumRenamed_CName")
|
||||
|
||||
Reference in New Issue
Block a user