Skip to content

Commit e57fd26

Browse files
authored
Merge pull request #2 from prezi/update-deployment-target
Update deployment target to 10.13
2 parents 157af1b + e9e1bb0 commit e57fd26

13 files changed

+55
-57
lines changed

ReactiveObjC.podspec

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Pod::Spec.new do |s|
2222
s.social_media_url = "https://twitter.com/ReactiveCocoa"
2323

2424
s.ios.deployment_target = "8.0"
25-
s.osx.deployment_target = "10.9"
25+
s.osx.deployment_target = "10.13"
2626
s.watchos.deployment_target = "2.0"
2727
s.tvos.deployment_target = "9.0"
2828

ReactiveObjC.xcodeproj/project.pbxproj

+5-4
Original file line numberDiff line numberDiff line change
@@ -1977,6 +1977,7 @@
19771977
developmentRegion = English;
19781978
hasScannedForEncodings = 0;
19791979
knownRegions = (
1980+
English,
19801981
en,
19811982
);
19821983
mainGroup = D04725E019E49ED7006002AA;
@@ -2760,7 +2761,7 @@
27602761
CURRENT_PROJECT_VERSION = 1;
27612762
ENABLE_TESTABILITY = YES;
27622763
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
2763-
MACOSX_DEPLOYMENT_TARGET = 10.9;
2764+
MACOSX_DEPLOYMENT_TARGET = 10.13;
27642765
PRODUCT_BUNDLE_IDENTIFIER = "org.reactivecocoa.$(PRODUCT_NAME:rfc1034identifier)";
27652766
PRODUCT_NAME = "$(PROJECT_NAME)";
27662767
TVOS_DEPLOYMENT_TARGET = 9.0;
@@ -2783,7 +2784,7 @@
27832784
CURRENT_PROJECT_VERSION = 1;
27842785
GCC_OPTIMIZATION_LEVEL = 0;
27852786
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
2786-
MACOSX_DEPLOYMENT_TARGET = 10.9;
2787+
MACOSX_DEPLOYMENT_TARGET = 10.13;
27872788
PRODUCT_BUNDLE_IDENTIFIER = "org.reactivecocoa.$(PRODUCT_NAME:rfc1034identifier)";
27882789
PRODUCT_NAME = "$(PROJECT_NAME)";
27892790
TVOS_DEPLOYMENT_TARGET = 9.0;
@@ -2909,7 +2910,7 @@
29092910
CODE_SIGNING_REQUIRED = NO;
29102911
CURRENT_PROJECT_VERSION = 1;
29112912
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
2912-
MACOSX_DEPLOYMENT_TARGET = 10.9;
2913+
MACOSX_DEPLOYMENT_TARGET = 10.13;
29132914
PRODUCT_BUNDLE_IDENTIFIER = "org.reactivecocoa.$(PRODUCT_NAME:rfc1034identifier)";
29142915
PRODUCT_NAME = "$(PROJECT_NAME)";
29152916
TVOS_DEPLOYMENT_TARGET = 9.0;
@@ -2983,7 +2984,7 @@
29832984
CODE_SIGNING_REQUIRED = NO;
29842985
CURRENT_PROJECT_VERSION = 1;
29852986
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
2986-
MACOSX_DEPLOYMENT_TARGET = 10.9;
2987+
MACOSX_DEPLOYMENT_TARGET = 10.13;
29872988
PRODUCT_BUNDLE_IDENTIFIER = "org.reactivecocoa.$(PRODUCT_NAME:rfc1034identifier)-Tests";
29882989
PRODUCT_NAME = "$(PROJECT_NAME)";
29892990
TVOS_DEPLOYMENT_TARGET = 9.0;

ReactiveObjC.xcodeproj/xcshareddata/xcschemes/ReactiveObjC-macOS.xcscheme

+10-14
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
LastUpgradeVersion = "0800"
44
version = "1.3">
55
<BuildAction
6-
parallelizeBuildables = "NO"
6+
parallelizeBuildables = "YES"
77
buildImplicitDependencies = "NO">
88
<BuildActionEntries>
99
<BuildActionEntry
@@ -70,6 +70,15 @@
7070
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
7171
shouldUseLaunchSchemeArgsEnv = "YES"
7272
codeCoverageEnabled = "YES">
73+
<MacroExpansion>
74+
<BuildableReference
75+
BuildableIdentifier = "primary"
76+
BlueprintIdentifier = "D04725E919E49ED7006002AA"
77+
BuildableName = "ReactiveObjC.framework"
78+
BlueprintName = "ReactiveObjC-macOS"
79+
ReferencedContainer = "container:ReactiveObjC.xcodeproj">
80+
</BuildableReference>
81+
</MacroExpansion>
7382
<Testables>
7483
<TestableReference
7584
skipped = "NO">
@@ -82,17 +91,6 @@
8291
</BuildableReference>
8392
</TestableReference>
8493
</Testables>
85-
<MacroExpansion>
86-
<BuildableReference
87-
BuildableIdentifier = "primary"
88-
BlueprintIdentifier = "D04725E919E49ED7006002AA"
89-
BuildableName = "ReactiveObjC.framework"
90-
BlueprintName = "ReactiveObjC-macOS"
91-
ReferencedContainer = "container:ReactiveObjC.xcodeproj">
92-
</BuildableReference>
93-
</MacroExpansion>
94-
<AdditionalOptions>
95-
</AdditionalOptions>
9694
</TestAction>
9795
<LaunchAction
9896
buildConfiguration = "Debug"
@@ -113,8 +111,6 @@
113111
ReferencedContainer = "container:ReactiveObjC.xcodeproj">
114112
</BuildableReference>
115113
</MacroExpansion>
116-
<AdditionalOptions>
117-
</AdditionalOptions>
118114
</LaunchAction>
119115
<ProfileAction
120116
buildConfiguration = "Profile"

ReactiveObjC/NSObject+RACPropertySubscribing.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
//
88

99
#import <Foundation/Foundation.h>
10-
#import <ReactiveObjC/RACEXTKeyPathCoding.h>
11-
#import "RACmetamacros.h"
10+
#import <ReactiveObjC/EXTKeyPathCoding.h>
11+
#import "metamacros.h"
1212

1313
/// Creates a signal which observes `KEYPATH` on `TARGET` for changes.
1414
///

ReactiveObjC/RACCommand.m

+5-5
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
//
88

99
#import "RACCommand.h"
10-
#import <ReactiveObjC/RACEXTScope.h>
10+
#import <ReactiveObjC/EXTScope.h>
1111
#import "NSArray+RACSequenceAdditions.h"
1212
#import "NSObject+RACDeallocating.h"
1313
#import "NSObject+RACDescription.h"
@@ -17,7 +17,7 @@
1717
#import "RACScheduler.h"
1818
#import "RACSequence.h"
1919
#import "RACSignal+Operations.h"
20-
#import <libkern/OSAtomic.h>
20+
#import <stdatomic.h>
2121

2222
NSString * const RACCommandErrorDomain = @"RACCommandErrorDomain";
2323
NSString * const RACUnderlyingCommandErrorKey = @"RACUnderlyingCommandErrorKey";
@@ -26,7 +26,7 @@
2626

2727
@interface RACCommand () {
2828
// Atomic backing variable for `allowsConcurrentExecution`.
29-
volatile uint32_t _allowsConcurrentExecution;
29+
atomic_uint _allowsConcurrentExecution;
3030
}
3131

3232
/// A subject that sends added execution signals.
@@ -55,9 +55,9 @@ - (BOOL)allowsConcurrentExecution {
5555

5656
- (void)setAllowsConcurrentExecution:(BOOL)allowed {
5757
if (allowed) {
58-
OSAtomicOr32Barrier(1, &_allowsConcurrentExecution);
58+
atomic_fetch_or(&_allowsConcurrentExecution, 1);
5959
} else {
60-
OSAtomicAnd32Barrier(0, &_allowsConcurrentExecution);
60+
atomic_fetch_and(&_allowsConcurrentExecution, 0);
6161
}
6262

6363
[self.allowsConcurrentExecutionSubject sendNext:@(_allowsConcurrentExecution)];

ReactiveObjC/RACDisposable.m

+5-5
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@
88

99
#import "RACDisposable.h"
1010
#import "RACScopedDisposable.h"
11-
#import <libkern/OSAtomic.h>
11+
#import <stdatomic.h>
1212

1313
@interface RACDisposable () {
1414
// A copied block of type void (^)(void) containing the logic for disposal,
1515
// a pointer to `self` if no logic should be performed upon disposal, or
1616
// NULL if the receiver is already disposed.
1717
//
1818
// This should only be used atomically.
19-
void * volatile _disposeBlock;
19+
_Atomic(void *) _disposeBlock;
2020
}
2121

2222
@end
@@ -35,7 +35,7 @@ - (instancetype)init {
3535
self = [super init];
3636

3737
_disposeBlock = (__bridge void *)self;
38-
OSMemoryBarrier();
38+
atomic_thread_fence(memory_order_seq_cst);
3939

4040
return self;
4141
}
@@ -46,7 +46,7 @@ - (instancetype)initWithBlock:(void (^)(void))block {
4646
self = [super init];
4747

4848
_disposeBlock = (void *)CFBridgingRetain([block copy]);
49-
OSMemoryBarrier();
49+
atomic_thread_fence(memory_order_seq_cst);
5050

5151
return self;
5252
}
@@ -69,7 +69,7 @@ - (void)dispose {
6969

7070
while (YES) {
7171
void *blockPtr = _disposeBlock;
72-
if (OSAtomicCompareAndSwapPtrBarrier(blockPtr, NULL, &_disposeBlock)) {
72+
if (atomic_compare_exchange_strong(&_disposeBlock, &blockPtr, NULL)) {
7373
if (blockPtr != (__bridge void *)self) {
7474
disposeBlock = CFBridgingRelease(blockPtr);
7575
}

ReactiveObjC/RACDynamicSequence.m

+4-4
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
//
88

99
#import "RACDynamicSequence.h"
10-
#import <libkern/OSAtomic.h>
10+
#import <stdatomic.h>
1111

1212
// Determines how RACDynamicSequences will be deallocated before the next one is
1313
// shifted onto the autorelease pool.
@@ -114,10 +114,10 @@ + (RACSequence *)sequenceWithLazyDependency:(id (^)(void))dependencyBlock headBl
114114
}
115115

116116
- (void)dealloc {
117-
static volatile int32_t directDeallocCount = 0;
117+
static atomic_int directDeallocCount = 0;
118118

119-
if (OSAtomicIncrement32(&directDeallocCount) >= DEALLOC_OVERFLOW_GUARD) {
120-
OSAtomicAdd32(-DEALLOC_OVERFLOW_GUARD, &directDeallocCount);
119+
if (atomic_fetch_add(&directDeallocCount, 1) + 1 >= DEALLOC_OVERFLOW_GUARD) {
120+
atomic_fetch_add(&directDeallocCount, -DEALLOC_OVERFLOW_GUARD);
121121

122122
// Put this sequence's tail onto the autorelease pool so we stop
123123
// recursing.

ReactiveObjC/RACKVOChannel.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
//
88

99
#import "RACChannel.h"
10-
#import <ReactiveObjC/RACEXTKeyPathCoding.h>
11-
#import "RACmetamacros.h"
10+
#import <ReactiveObjC/EXTKeyPathCoding.h>
11+
#import "metamacros.h"
1212

1313
/// Creates a RACKVOChannel to the given key path. When the targeted object
1414
/// deallocates, the channel will complete.

ReactiveObjC/RACMulticastConnection.m

+7-6
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#import "RACDisposable.h"
1212
#import "RACSerialDisposable.h"
1313
#import "RACSubject.h"
14-
#import <libkern/OSAtomic.h>
14+
#import <stdatomic.h>
1515

1616
@interface RACMulticastConnection () {
1717
RACSubject *_signal;
@@ -24,7 +24,7 @@ @interface RACMulticastConnection () {
2424
//
2525
// If the swap is unsuccessful it means that `_sourceSignal` has already been
2626
// connected and the caller has no action to take.
27-
int32_t volatile _hasConnected;
27+
_Atomic(BOOL) _hasConnected;
2828
}
2929

3030
@property (nonatomic, readonly, strong) RACSignal *sourceSignal;
@@ -51,7 +51,8 @@ - (instancetype)initWithSourceSignal:(RACSignal *)source subject:(RACSubject *)s
5151
#pragma mark Connecting
5252

5353
- (RACDisposable *)connect {
54-
BOOL shouldConnect = OSAtomicCompareAndSwap32Barrier(0, 1, &_hasConnected);
54+
BOOL expected = NO;
55+
BOOL shouldConnect = atomic_compare_exchange_strong(&_hasConnected, &expected, YES);
5556

5657
if (shouldConnect) {
5758
self.serialDisposable.disposable = [self.sourceSignal subscribe:_signal];
@@ -61,19 +62,19 @@ - (RACDisposable *)connect {
6162
}
6263

6364
- (RACSignal *)autoconnect {
64-
__block volatile int32_t subscriberCount = 0;
65+
__block atomic_int subscriberCount = 0;
6566

6667
return [[RACSignal
6768
createSignal:^(id<RACSubscriber> subscriber) {
68-
OSAtomicIncrement32Barrier(&subscriberCount);
69+
atomic_fetch_add(&subscriberCount, 1);
6970

7071
RACDisposable *subscriptionDisposable = [self.signal subscribe:subscriber];
7172
RACDisposable *connectionDisposable = [self connect];
7273

7374
return [RACDisposable disposableWithBlock:^{
7475
[subscriptionDisposable dispose];
7576

76-
if (OSAtomicDecrement32Barrier(&subscriberCount) == 0) {
77+
if (atomic_fetch_sub(&subscriberCount, 1) - 1 == 0) {
7778
[connectionDisposable dispose];
7879
}
7980
}];

ReactiveObjC/RACSignal+Operations.m

+7-7
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
#import "RACSubscriber.h"
2727
#import "RACTuple.h"
2828
#import "RACUnit.h"
29-
#import <libkern/OSAtomic.h>
29+
#import <stdatomic.h>
3030
#import <objc/runtime.h>
3131

3232
NSString * const RACSignalErrorDomain = @"RACSignalErrorDomain";
@@ -649,7 +649,7 @@ - (RACDisposable *)setKeyPath:(NSString *)keyPath onObject:(NSObject *)object ni
649649

650650
// Purposely not retaining 'object', since we want to tear down the binding
651651
// when it deallocates normally.
652-
__block void * volatile objectPtr = (__bridge void *)object;
652+
__block _Atomic(void *) objectPtr = (__bridge void *)object;
653653

654654
RACDisposable *subscriptionDisposable = [self subscribeNext:^(id x) {
655655
// Possibly spec, possibly compiler bug, but this __bridge cast does not
@@ -701,7 +701,7 @@ - (RACDisposable *)setKeyPath:(NSString *)keyPath onObject:(NSObject *)object ni
701701

702702
while (YES) {
703703
void *ptr = objectPtr;
704-
if (OSAtomicCompareAndSwapPtrBarrier(ptr, NULL, &objectPtr)) {
704+
if (atomic_compare_exchange_strong(&objectPtr, &ptr, NULL)) {
705705
break;
706706
}
707707
}
@@ -1051,17 +1051,17 @@ - (RACSignal *)subscribeOn:(RACScheduler *)scheduler {
10511051

10521052
- (RACSignal *)deliverOnMainThread {
10531053
return [[RACSignal createSignal:^(id<RACSubscriber> subscriber) {
1054-
__block volatile int32_t queueLength = 0;
1054+
__block atomic_int queueLength = 0;
10551055

10561056
void (^performOnMainThread)(dispatch_block_t) = ^(dispatch_block_t block) {
1057-
int32_t queued = OSAtomicIncrement32(&queueLength);
1057+
int32_t queued = atomic_fetch_add(&queueLength, 1) + 1;
10581058
if (NSThread.isMainThread && queued == 1) {
10591059
block();
1060-
OSAtomicDecrement32(&queueLength);
1060+
atomic_fetch_sub(&queueLength, 1);
10611061
} else {
10621062
dispatch_async(dispatch_get_main_queue(), ^{
10631063
block();
1064-
OSAtomicDecrement32(&queueLength);
1064+
atomic_fetch_sub(&queueLength, 1);
10651065
});
10661066
}
10671067
};

ReactiveObjC/RACSignal.m

+4-4
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
#import "RACSubject.h"
2222
#import "RACSubscriber+Private.h"
2323
#import "RACTuple.h"
24-
#import <libkern/OSAtomic.h>
24+
#import <stdatomic.h>
2525

2626
@implementation RACSignal
2727

@@ -108,12 +108,12 @@ - (RACSignal *)bind:(RACSignalBindBlock (^)(void))block {
108108
return [[RACSignal createSignal:^(id<RACSubscriber> subscriber) {
109109
RACSignalBindBlock bindingBlock = block();
110110

111-
__block volatile int32_t signalCount = 1; // indicates self
111+
__block atomic_int signalCount = 1; // indicates self
112112

113113
RACCompoundDisposable *compoundDisposable = [RACCompoundDisposable compoundDisposable];
114114

115115
void (^completeSignal)(RACDisposable *) = ^(RACDisposable *finishedDisposable) {
116-
if (OSAtomicDecrement32Barrier(&signalCount) == 0) {
116+
if (atomic_fetch_sub(&signalCount, 1) - 1 == 0) {
117117
[subscriber sendCompleted];
118118
[compoundDisposable dispose];
119119
} else {
@@ -122,7 +122,7 @@ - (RACSignal *)bind:(RACSignalBindBlock (^)(void))block {
122122
};
123123

124124
void (^addSignal)(RACSignal *) = ^(RACSignal *signal) {
125-
OSAtomicIncrement32Barrier(&signalCount);
125+
atomic_fetch_add(&signalCount, 1);
126126

127127
RACSerialDisposable *selfDisposable = [[RACSerialDisposable alloc] init];
128128
[compoundDisposable addDisposable:selfDisposable];

ReactiveObjC/RACSubscriptingAssignmentTrampoline.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
//
88

99
#import <Foundation/Foundation.h>
10-
#import <ReactiveObjC/RACEXTKeyPathCoding.h>
10+
#import <ReactiveObjC/EXTKeyPathCoding.h>
1111

1212
@class RACSignal;
1313

ReactiveObjC/extobjc/EXTRuntimeExtensions.m

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
// Released under the MIT license.
88
//
99

10-
#import <ReactiveObjC/EXTRuntimeExtensions.h>
10+
#import "EXTRuntimeExtensions.h"
1111

1212
#import <ctype.h>
1313
#import <Foundation/Foundation.h>
@@ -62,7 +62,7 @@
6262

6363
if (!next) {
6464
fprintf(stderr, "ERROR: Could not read class name in attribute string \"%s\" for property %s\n", attrString, property_getName(property));
65-
return NULL;
65+
goto errorOut;
6666
}
6767

6868
if (className != next) {

0 commit comments

Comments
 (0)