File tree Expand file tree Collapse file tree 1 file changed +8
-7
lines changed
test/stdlib/Inputs/NSSlowTaggedLocalizedString Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Original file line number Diff line number Diff line change 2
2
#import " NSSlowTaggedLocalizedString.h"
3
3
#import < dlfcn.h>
4
4
#import < objc/runtime.h>
5
+ #import < Foundation/Foundation.h>
5
6
6
- // If and when CF starts linking Swift we may need to rethink this
7
- #import < CoreFoundation/CoreFoundation.h>
7
+ /*
8
+ This horrific mess is simulating the new-in-macOS-Ventura tagged pointer strings,
9
+ which can have lengths >15 characters, which can cause problems in SmallString,
10
+ which used to assume that would never happen. Once CI is running on Ventura or
11
+ later, this can be rewritten to use a regular NSLocalizedString.
12
+ */
8
13
9
14
@implementation NSSlowTaggedLocalizedString
10
15
11
- typedef struct _NSRange {
12
- uint64_t location;
13
- uint64_t length;
14
- } NSRange ;
15
-
16
16
+ (instancetype ) createTestString {
17
17
#if __LP64__
18
18
static dispatch_once_t onceToken;
19
19
dispatch_once (&onceToken, ^{
20
+ [[[NSString alloc ] init ] release ]; // Make sure NSString is initialized
20
21
Class tagClass = objc_lookUpClass (" NSTaggedPointerString" );
21
22
Class ourClass = [NSSlowTaggedLocalizedString class ];
22
23
You can’t perform that action at this time.
0 commit comments