Move NS run loop mode definitions into CF

This commit is contained in:
Lubos Dolezel 2018-08-14 17:53:41 +02:00
parent b93972862e
commit 60edc4fb97
3 changed files with 30 additions and 0 deletions

View File

@ -153,6 +153,7 @@ set(cf_sources
NSZombie.m
CFForwardingPrep.S
FoundationExceptions.m
NSRunLoopModes.m
)
add_separated_framework(CoreFoundation

25
NSRunLoopModes.m Normal file
View File

@ -0,0 +1,25 @@
//
// NSRunLoopModes.m
// Foundation
//
// Copyright (c) 2014 Apportable. All rights reserved.
//
#import <Foundation/NSString.h>
#import <CoreFoundation/CFRunLoop.h>
#import "NSRunLoopModesInternal.h"
// Forgive me, the loader is not merging NSStrings/CFStrings correctly
// This is a VERY hacky workaround.
#warning https://code.google.com/p/apportable/issues/detail?id=370
NSString *NSDefaultRunLoopMode = nil;
NSString *NSRunLoopCommonModes = nil;
static void NSRunLoopModeFix(void) __attribute__((constructor));
static void NSRunLoopModeFix(void)
{
NSDefaultRunLoopMode = (NSString *)kCFRunLoopDefaultMode;
NSRunLoopCommonModes = (NSString *)kCFRunLoopCommonModes;
}

4
NSRunLoopModesInternal.h Normal file
View File

@ -0,0 +1,4 @@
@class NSString;
extern NSString *NSDefaultRunLoopMode;
extern NSString *NSRunLoopCommonModes;