Skip to content

Commit

Permalink
Issues #115. Fix Xcode 9 prototype function issues.
Browse files Browse the repository at this point in the history
  • Loading branch information
wangbo authored and andersio committed Dec 23, 2017
1 parent 1ce5316 commit bb83815
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 8 deletions.
4 changes: 2 additions & 2 deletions ReactiveObjC/RACSequence.h
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ typedef RACSequence * _Nullable (^RACSequenceBindBlock)(ValueType _Nullable valu
/// return value must be an object. This argument cannot be nil.
///
/// Returns a new sequence of reduced tuple values.
- (RACSequence *)reduceEach:(id _Nullable (^)())reduceBlock;
- (RACSequence *)reduceEach:(RACReduceBlock)reduceBlock;

/// Returns a sequence consisting of `value`, followed by the values in the
/// receiver.
Expand Down Expand Up @@ -309,7 +309,7 @@ typedef RACSequence * _Nullable (^RACSequenceBindBlock)(ValueType _Nullable valu
///
/// Returns a new sequence containing the results from each invocation of
/// `reduceBlock`.
+ (RACSequence<ValueType> *)zip:(id<NSFastEnumeration>)sequences reduce:(id _Nullable (^)())reduceBlock;
+ (RACSequence<ValueType> *)zip:(id<NSFastEnumeration>)sequences reduce:(RACReduceBlock)reduceBlock;

/// Returns a sequence obtained by concatenating `sequences` in order.
+ (RACSequence<ValueType> *)concat:(id<NSFastEnumeration>)sequences;
Expand Down
3 changes: 2 additions & 1 deletion ReactiveObjC/RACSignal+Operations.h
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,8 @@ extern const NSInteger RACSignalErrorNoMatchingCase;
///
/// Returns a signal which sends the results from each invocation of
/// `reduceBlock`.
+ (RACSignal<ValueType> *)combineLatest:(id<NSFastEnumeration>)signals reduce:(ValueType _Nullable (^)())reduceBlock RAC_WARN_UNUSED_RESULT;
+ (RACSignal<ValueType> *)combineLatest:(id<NSFastEnumeration>)signals reduce:(RACReduceBlock2)reduceBlock RAC_WARN_UNUSED_RESULT;


/// Merges the receiver and the given signal with `+merge:` and returns the
/// resulting signal.
Expand Down
4 changes: 2 additions & 2 deletions ReactiveObjC/RACSignal.h
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ typedef RACSignal * _Nullable (^RACSignalBindBlock)(ValueType _Nullable value, B
/// return value must be an object. This argument cannot be nil.
///
/// Returns a new signal of reduced tuple values.
- (RACSignal *)reduceEach:(id _Nullable (^)())reduceBlock RAC_WARN_UNUSED_RESULT;
- (RACSignal *)reduceEach:(RACReduceBlock)reduceBlock RAC_WARN_UNUSED_RESULT;

/// Returns a signal consisting of `value`, followed by the values in the
/// receiver.
Expand Down Expand Up @@ -268,7 +268,7 @@ typedef RACSignal * _Nullable (^RACSignalBindBlock)(ValueType _Nullable value, B
///
/// Returns a new signal containing the results from each invocation of
/// `reduceBlock`.
+ (RACSignal<ValueType> *)zip:(id<NSFastEnumeration>)signals reduce:(id _Nullable (^)())reduceBlock RAC_WARN_UNUSED_RESULT;
+ (RACSignal<ValueType> *)zip:(id<NSFastEnumeration>)signals reduce:(RACReduceBlock)reduceBlock RAC_WARN_UNUSED_RESULT;

/// Returns a signal obtained by concatenating `signals` in order.
+ (RACSignal<ValueType> *)concat:(id<NSFastEnumeration>)signals RAC_WARN_UNUSED_RESULT;
Expand Down
10 changes: 8 additions & 2 deletions ReactiveObjC/RACStream.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ NS_ASSUME_NONNULL_BEGIN
/// to be overridden.
@interface RACStream<__covariant ValueType> : NSObject

_Pragma("clang diagnostic push") \
_Pragma("clang diagnostic ignored \"-Wstrict-prototypes\"") \
typedef id _Nullable (^RACReduceBlock)();
typedef ValueType _Nullable (^RACReduceBlock2)();
_Pragma("clang diagnostic pop")

/// Returns an empty stream.
+ (__kindof RACStream<ValueType> *)empty;

Expand Down Expand Up @@ -170,7 +176,7 @@ typedef RACStream * _Nullable (^RACStreamBindBlock)(ValueType _Nullable value, B
/// return value must be an object. This argument cannot be nil.
///
/// Returns a new stream of reduced tuple values.
- (__kindof RACStream *)reduceEach:(id _Nullable (^)())reduceBlock;
- (__kindof RACStream *)reduceEach:(RACReduceBlock)reduceBlock;

/// Returns a stream consisting of `value`, followed by the values in the
/// receiver.
Expand Down Expand Up @@ -221,7 +227,7 @@ typedef RACStream * _Nullable (^RACStreamBindBlock)(ValueType _Nullable value, B
///
/// Returns a new stream containing the results from each invocation of
/// `reduceBlock`.
+ (__kindof RACStream<ValueType> *)zip:(id<NSFastEnumeration>)streams reduce:(id _Nullable (^)())reduceBlock;
+ (__kindof RACStream<ValueType> *)zip:(id<NSFastEnumeration>)streams reduce:(RACReduceBlock)reduceBlock;

/// Returns a stream obtained by concatenating `streams` in order.
+ (__kindof RACStream<ValueType> *)concat:(id<NSFastEnumeration>)streams;
Expand Down
2 changes: 1 addition & 1 deletion ReactiveObjC/extobjc/EXTScope.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
_Pragma("clang diagnostic pop")

/*** implementation details follow ***/
typedef void (^rac_cleanupBlock_t)();
typedef void (^rac_cleanupBlock_t)(void);

static inline void rac_executeCleanupBlock (__strong rac_cleanupBlock_t *block) {
(*block)();
Expand Down

0 comments on commit bb83815

Please sign in to comment.