File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
stdlib/public/SDK/Foundation Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change 1
1
#import < Foundation/Foundation.h>
2
2
3
+ #include < objc/runtime.h>
4
+
3
5
#include " swift/Runtime/Metadata.h"
4
6
7
+ // Aliases for Objective-C runtime entry points.
8
+ static const char *class_getName (const swift::ClassMetadata* type) {
9
+ return class_getName (
10
+ reinterpret_cast <Class >(const_cast <swift::ClassMetadata*>(type)));
11
+ }
12
+
5
13
@interface NSKeyedUnarchiver (SwiftAdditions)
6
14
+ (int )_swift_checkClassAndWarnForKeyedArchiving : (Class )cls
7
15
operation : (int )operation
@@ -35,9 +43,8 @@ + (int)_swift_checkClassAndWarnForKeyedArchiving:(Class)cls
35
43
if (theClass->getFlags () & swift::ClassFlags::HasCustomObjCName)
36
44
return 0 ;
37
45
38
- const char *className = [NSStringFromClass (cls) UTF8String ];
39
-
40
46
// Is it a mangled name?
47
+ const char *className = class_getName (theClass);
41
48
if (!(className[0 ] == ' _' && className[1 ] == ' T' ))
42
49
return 0 ;
43
50
// Is it a name in the form <module>.<class>? Note: the module name could
You can’t perform that action at this time.
0 commit comments