Permalink
Browse files

Fix DISABLE_SWIZZLING compilation

Some methods under the compiler flag are being used by RxCocoa's proxy
delegate. So this commit is moving these outside the conditional.
  • Loading branch information...
Reflejo authored and kzaher committed Nov 18, 2018
1 parent 67ae806 commit 52d99673cfd2acb8c433b54b31a553fa3dc06a2c
@@ -16,13 +16,13 @@
#import "include/_RX.h"
#import "include/_RXObjCRuntime.h"

// self + cmd
#define HIDDEN_ARGUMENT_COUNT 2

#if !DISABLE_SWIZZLING

#define NSErrorParam NSError *__autoreleasing __nullable * __nullable

// self + cmd
#define HIDDEN_ARGUMENT_COUNT 2

@class RXObjCRuntime;

BOOL RXAbortOnThreadingHazard = NO;
@@ -130,6 +130,8 @@ SEL __nonnull RX_selector(SEL __nonnull selector) {
return NSSelectorFromString([RX_PREFIX stringByAppendingString:selectorString]);
}

#endif

BOOL RX_is_method_signature_void(NSMethodSignature * __nonnull methodSignature) {
const char *methodReturnType = methodSignature.methodReturnType;
return strcmp(methodReturnType, @encode(void)) == 0;
@@ -202,6 +204,12 @@ id __nonnull RX_extract_argument_at_index(NSInvocation * __nonnull invocation, N
return arguments;
}

IMP __nonnull RX_default_target_implementation(void) {
return _objc_msgForward;
}

#if !DISABLE_SWIZZLING

void * __nonnull RX_reference_from_selector(SEL __nonnull selector) {
return selector;
}
@@ -316,10 +324,6 @@ IMP __nullable RX_ensure_observing(id __nonnull target, SEL __nonnull selector,
return targetImplementation;
}

IMP __nonnull RX_default_target_implementation(void) {
return _objc_msgForward;
}

// bodies

#define FORWARD_BODY(invocation) if (RX_forward_invocation(self, NAME_CAT(_, 0, invocation))) { return; }
@@ -87,6 +87,8 @@ void * __nonnull RX_reference_from_selector(SEL __nonnull selector);
/// Ensures interceptor is installed on target object.
IMP __nullable RX_ensure_observing(id __nonnull target, SEL __nonnull selector, NSError *__autoreleasing __nullable * __nullable error);

#endif

/// Extracts arguments for `invocation`.
NSArray * __nonnull RX_extract_arguments(NSInvocation * __nonnull invocation);

@@ -98,5 +100,3 @@ BOOL RX_is_method_signature_void(NSMethodSignature * __nonnull methodSignature);

/// Default value for `RXInterceptionObserver.targetImplementation`.
IMP __nonnull RX_default_target_implementation(void);

#endif
@@ -87,6 +87,8 @@ void * __nonnull RX_reference_from_selector(SEL __nonnull selector);
/// Ensures interceptor is installed on target object.
IMP __nullable RX_ensure_observing(id __nonnull target, SEL __nonnull selector, NSError *__autoreleasing __nullable * __nullable error);

#endif

/// Extracts arguments for `invocation`.
NSArray * __nonnull RX_extract_arguments(NSInvocation * __nonnull invocation);

@@ -98,5 +100,3 @@ BOOL RX_is_method_signature_void(NSMethodSignature * __nonnull methodSignature);

/// Default value for `RXInterceptionObserver.targetImplementation`.
IMP __nonnull RX_default_target_implementation(void);

#endif

0 comments on commit 52d9967

Please sign in to comment.