mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Now that we use the C names of imported types in mangled names, it's safe to resolve a compatibility alias when a type gets an NS_SWIFT_NAME for the first time, rather than requiring the developer to recompile the imported library. This doesn't include generic types, which only applies for Objective-C generics. There shouldn't be additional complications here but I want to be extra careful. rdar://problem/39661212
23 lines
474 B
C
23 lines
474 B
C
#if NEW
|
|
# define NEW_NAME(x) __attribute__((swift_name(#x)))
|
|
#else
|
|
# define NEW_NAME(x)
|
|
#endif
|
|
|
|
struct BeforeStruct {
|
|
int value;
|
|
} NEW_NAME(AfterStruct);
|
|
|
|
typedef int BeforeTypedef NEW_NAME(AfterTypedef);
|
|
typedef int BeforeWrappedTypedef __attribute__((swift_wrapper(struct))) NEW_NAME(AfterWrappedTypedef);
|
|
|
|
#if NEW
|
|
typedef struct DifferentStruct {
|
|
int value;
|
|
} BeforeReplacedType NEW_NAME(AfterReplacedType);
|
|
#else
|
|
struct BeforeReplacedType {
|
|
float value;
|
|
};
|
|
#endif
|