Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update deployment target to 10.13 #2

Merged
merged 7 commits into from
Nov 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ReactiveObjC.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Pod::Spec.new do |s|
s.social_media_url = "https://twitter.com/ReactiveCocoa"

s.ios.deployment_target = "8.0"
s.osx.deployment_target = "10.9"
s.osx.deployment_target = "10.13"
s.watchos.deployment_target = "2.0"
s.tvos.deployment_target = "9.0"

Expand Down
9 changes: 5 additions & 4 deletions ReactiveObjC.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1977,6 +1977,7 @@
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
English,
en,
);
mainGroup = D04725E019E49ED7006002AA;
Expand Down Expand Up @@ -2760,7 +2761,7 @@
CURRENT_PROJECT_VERSION = 1;
ENABLE_TESTABILITY = YES;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
MACOSX_DEPLOYMENT_TARGET = 10.9;
MACOSX_DEPLOYMENT_TARGET = 10.13;
PRODUCT_BUNDLE_IDENTIFIER = "org.reactivecocoa.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(PROJECT_NAME)";
TVOS_DEPLOYMENT_TARGET = 9.0;
Expand All @@ -2783,7 +2784,7 @@
CURRENT_PROJECT_VERSION = 1;
GCC_OPTIMIZATION_LEVEL = 0;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
MACOSX_DEPLOYMENT_TARGET = 10.9;
MACOSX_DEPLOYMENT_TARGET = 10.13;
PRODUCT_BUNDLE_IDENTIFIER = "org.reactivecocoa.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(PROJECT_NAME)";
TVOS_DEPLOYMENT_TARGET = 9.0;
Expand Down Expand Up @@ -2909,7 +2910,7 @@
CODE_SIGNING_REQUIRED = NO;
CURRENT_PROJECT_VERSION = 1;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
MACOSX_DEPLOYMENT_TARGET = 10.9;
MACOSX_DEPLOYMENT_TARGET = 10.13;
PRODUCT_BUNDLE_IDENTIFIER = "org.reactivecocoa.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(PROJECT_NAME)";
TVOS_DEPLOYMENT_TARGET = 9.0;
Expand Down Expand Up @@ -2983,7 +2984,7 @@
CODE_SIGNING_REQUIRED = NO;
CURRENT_PROJECT_VERSION = 1;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
MACOSX_DEPLOYMENT_TARGET = 10.9;
MACOSX_DEPLOYMENT_TARGET = 10.13;
PRODUCT_BUNDLE_IDENTIFIER = "org.reactivecocoa.$(PRODUCT_NAME:rfc1034identifier)-Tests";
PRODUCT_NAME = "$(PROJECT_NAME)";
TVOS_DEPLOYMENT_TARGET = 9.0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
LastUpgradeVersion = "0800"
version = "1.3">
<BuildAction
parallelizeBuildables = "NO"
parallelizeBuildables = "YES"
buildImplicitDependencies = "NO">
<BuildActionEntries>
<BuildActionEntry
Expand Down Expand Up @@ -70,6 +70,15 @@
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
codeCoverageEnabled = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "D04725E919E49ED7006002AA"
BuildableName = "ReactiveObjC.framework"
BlueprintName = "ReactiveObjC-macOS"
ReferencedContainer = "container:ReactiveObjC.xcodeproj">
</BuildableReference>
</MacroExpansion>
<Testables>
<TestableReference
skipped = "NO">
Expand All @@ -82,17 +91,6 @@
</BuildableReference>
</TestableReference>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "D04725E919E49ED7006002AA"
BuildableName = "ReactiveObjC.framework"
BlueprintName = "ReactiveObjC-macOS"
ReferencedContainer = "container:ReactiveObjC.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
Expand All @@ -113,8 +111,6 @@
ReferencedContainer = "container:ReactiveObjC.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Profile"
Expand Down
4 changes: 2 additions & 2 deletions ReactiveObjC/NSObject+RACPropertySubscribing.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
//

#import <Foundation/Foundation.h>
#import <ReactiveObjC/RACEXTKeyPathCoding.h>
#import "RACmetamacros.h"
#import <ReactiveObjC/EXTKeyPathCoding.h>
#import "metamacros.h"

/// Creates a signal which observes `KEYPATH` on `TARGET` for changes.
///
Expand Down
10 changes: 5 additions & 5 deletions ReactiveObjC/RACCommand.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
//

#import "RACCommand.h"
#import <ReactiveObjC/RACEXTScope.h>
#import <ReactiveObjC/EXTScope.h>
#import "NSArray+RACSequenceAdditions.h"
#import "NSObject+RACDeallocating.h"
#import "NSObject+RACDescription.h"
Expand All @@ -17,7 +17,7 @@
#import "RACScheduler.h"
#import "RACSequence.h"
#import "RACSignal+Operations.h"
#import <libkern/OSAtomic.h>
#import <stdatomic.h>

NSString * const RACCommandErrorDomain = @"RACCommandErrorDomain";
NSString * const RACUnderlyingCommandErrorKey = @"RACUnderlyingCommandErrorKey";
Expand All @@ -26,7 +26,7 @@

@interface RACCommand () {
// Atomic backing variable for `allowsConcurrentExecution`.
volatile uint32_t _allowsConcurrentExecution;
atomic_uint _allowsConcurrentExecution;
}

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

- (void)setAllowsConcurrentExecution:(BOOL)allowed {
if (allowed) {
OSAtomicOr32Barrier(1, &_allowsConcurrentExecution);
atomic_fetch_or(&_allowsConcurrentExecution, 1);
} else {
OSAtomicAnd32Barrier(0, &_allowsConcurrentExecution);
atomic_fetch_and(&_allowsConcurrentExecution, 0);
}

[self.allowsConcurrentExecutionSubject sendNext:@(_allowsConcurrentExecution)];
Expand Down
10 changes: 5 additions & 5 deletions ReactiveObjC/RACDisposable.m
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@

#import "RACDisposable.h"
#import "RACScopedDisposable.h"
#import <libkern/OSAtomic.h>
#import <stdatomic.h>

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

@end
Expand All @@ -35,7 +35,7 @@ - (instancetype)init {
self = [super init];

_disposeBlock = (__bridge void *)self;
OSMemoryBarrier();
atomic_thread_fence(memory_order_seq_cst);

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

_disposeBlock = (void *)CFBridgingRetain([block copy]);
OSMemoryBarrier();
atomic_thread_fence(memory_order_seq_cst);

return self;
}
Expand All @@ -69,7 +69,7 @@ - (void)dispose {

while (YES) {
void *blockPtr = _disposeBlock;
if (OSAtomicCompareAndSwapPtrBarrier(blockPtr, NULL, &_disposeBlock)) {
if (atomic_compare_exchange_strong(&_disposeBlock, &blockPtr, NULL)) {
if (blockPtr != (__bridge void *)self) {
disposeBlock = CFBridgingRelease(blockPtr);
}
Expand Down
8 changes: 4 additions & 4 deletions ReactiveObjC/RACDynamicSequence.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
//

#import "RACDynamicSequence.h"
#import <libkern/OSAtomic.h>
#import <stdatomic.h>

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

- (void)dealloc {
static volatile int32_t directDeallocCount = 0;
static atomic_int directDeallocCount = 0;

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

// Put this sequence's tail onto the autorelease pool so we stop
// recursing.
Expand Down
4 changes: 2 additions & 2 deletions ReactiveObjC/RACKVOChannel.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
//

#import "RACChannel.h"
#import <ReactiveObjC/RACEXTKeyPathCoding.h>
#import "RACmetamacros.h"
#import <ReactiveObjC/EXTKeyPathCoding.h>
#import "metamacros.h"

/// Creates a RACKVOChannel to the given key path. When the targeted object
/// deallocates, the channel will complete.
Expand Down
13 changes: 7 additions & 6 deletions ReactiveObjC/RACMulticastConnection.m
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#import "RACDisposable.h"
#import "RACSerialDisposable.h"
#import "RACSubject.h"
#import <libkern/OSAtomic.h>
#import <stdatomic.h>

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

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

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

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

- (RACSignal *)autoconnect {
__block volatile int32_t subscriberCount = 0;
__block atomic_int subscriberCount = 0;

return [[RACSignal
createSignal:^(id<RACSubscriber> subscriber) {
OSAtomicIncrement32Barrier(&subscriberCount);
atomic_fetch_add(&subscriberCount, 1);

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

return [RACDisposable disposableWithBlock:^{
[subscriptionDisposable dispose];

if (OSAtomicDecrement32Barrier(&subscriberCount) == 0) {
if (atomic_fetch_sub(&subscriberCount, 1) - 1 == 0) {
[connectionDisposable dispose];
}
}];
Expand Down
14 changes: 7 additions & 7 deletions ReactiveObjC/RACSignal+Operations.m
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
#import "RACSubscriber.h"
#import "RACTuple.h"
#import "RACUnit.h"
#import <libkern/OSAtomic.h>
#import <stdatomic.h>
#import <objc/runtime.h>

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

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

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

while (YES) {
void *ptr = objectPtr;
if (OSAtomicCompareAndSwapPtrBarrier(ptr, NULL, &objectPtr)) {
if (atomic_compare_exchange_strong(&objectPtr, &ptr, NULL)) {
break;
}
}
Expand Down Expand Up @@ -1051,17 +1051,17 @@ - (RACSignal *)subscribeOn:(RACScheduler *)scheduler {

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

void (^performOnMainThread)(dispatch_block_t) = ^(dispatch_block_t block) {
int32_t queued = OSAtomicIncrement32(&queueLength);
int32_t queued = atomic_fetch_add(&queueLength, 1) + 1;
if (NSThread.isMainThread && queued == 1) {
block();
OSAtomicDecrement32(&queueLength);
atomic_fetch_sub(&queueLength, 1);
} else {
dispatch_async(dispatch_get_main_queue(), ^{
block();
OSAtomicDecrement32(&queueLength);
atomic_fetch_sub(&queueLength, 1);
});
}
};
Expand Down
8 changes: 4 additions & 4 deletions ReactiveObjC/RACSignal.m
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#import "RACSubject.h"
#import "RACSubscriber+Private.h"
#import "RACTuple.h"
#import <libkern/OSAtomic.h>
#import <stdatomic.h>

@implementation RACSignal

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

__block volatile int32_t signalCount = 1; // indicates self
__block atomic_int signalCount = 1; // indicates self

RACCompoundDisposable *compoundDisposable = [RACCompoundDisposable compoundDisposable];

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

void (^addSignal)(RACSignal *) = ^(RACSignal *signal) {
OSAtomicIncrement32Barrier(&signalCount);
atomic_fetch_add(&signalCount, 1);

RACSerialDisposable *selfDisposable = [[RACSerialDisposable alloc] init];
[compoundDisposable addDisposable:selfDisposable];
Expand Down
2 changes: 1 addition & 1 deletion ReactiveObjC/RACSubscriptingAssignmentTrampoline.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
//

#import <Foundation/Foundation.h>
#import <ReactiveObjC/RACEXTKeyPathCoding.h>
#import <ReactiveObjC/EXTKeyPathCoding.h>

@class RACSignal;

Expand Down
4 changes: 2 additions & 2 deletions ReactiveObjC/extobjc/EXTRuntimeExtensions.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
// Released under the MIT license.
//

#import <ReactiveObjC/EXTRuntimeExtensions.h>
#import "EXTRuntimeExtensions.h"

#import <ctype.h>
#import <Foundation/Foundation.h>
Expand Down Expand Up @@ -62,7 +62,7 @@

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

if (className != next) {
Expand Down