Permalink
Browse files

ViewDeckController will now compile (and work) with GCC 4.2.

  • Loading branch information...
Inferis committed Feb 8, 2012
1 parent 6d9f5b0 commit fa0580e49804470ca920b2f5d00ad0c84c05b2a4
Showing with 16 additions and 9 deletions.
  1. +6 −1 ViewDeck/IIViewDeckController.h
  2. +4 −8 ViewDeck/IIViewDeckController.m
  3. +6 −0 ViewDeck/WrappedController.m
@@ -59,7 +59,12 @@ typedef enum {
#define IIViewDeckCenterHiddenIsInteractive(interactivity) ((interactivity) == IIViewDeckCenterHiddenUserInteractive)
-@interface IIViewDeckController : UIViewController
+@interface IIViewDeckController : UIViewController {
+@private
+ CGFloat _panOrigin;
+ BOOL _viewAppeared;
+ CGFloat _preRotationWidth, _leftWidth, _rightWidth;
+}
@property (nonatomic, retain) id<IIViewDeckControllerDelegate> delegate;
@property (nonatomic, retain) UIViewController* centerController;
@@ -58,11 +58,7 @@
#define OPEN_SLIDE_DURATION(animated) SLIDE_DURATION(animated,DURATION_FAST)
#define CLOSE_SLIDE_DURATION(animated) SLIDE_DURATION(animated,DURATION_SLOW)
-@interface IIViewDeckController () <UIGestureRecognizerDelegate> {
- CGFloat _panOrigin;
- BOOL _viewAppeared;
- CGFloat _preRotationWidth, _leftWidth, _rightWidth;
-}
+@interface IIViewDeckController () <UIGestureRecognizerDelegate>
@property (nonatomic, retain) UIView* referenceView;
@property (nonatomic, readonly) CGRect referenceBounds;
@@ -925,17 +921,17 @@ - (void)removePanners {
- (BOOL)checkDelegate:(SEL)selector animated:(BOOL)animated {
BOOL ok = YES;
if (self.delegate && [self.delegate respondsToSelector:selector])
- ok = ok & (BOOL)objc_msgSend(self.delegate, selector, self, animated);
+ ok = ok & (BOOL)(int)objc_msgSend(self.delegate, selector, self, animated);
for (UIViewController* controller in self.controllers) {
// check controller first
if ([controller respondsToSelector:selector])
- ok = ok & (BOOL)objc_msgSend(controller, selector, self, animated);
+ ok = ok & (BOOL)(int)objc_msgSend(controller, selector, self, animated);
// if that fails, check if it's a navigation controller and use the top controller
else if ([controller isKindOfClass:[UINavigationController class]]) {
UIViewController* topController = ((UINavigationController*)controller).topViewController;
if ([topController respondsToSelector:selector])
- ok = ok & (BOOL)objc_msgSend(topController, selector, self, animated);
+ ok = ok & (BOOL)(int)objc_msgSend(topController, selector, self, animated);
}
}
@@ -23,6 +23,9 @@
// SOFTWARE.
//
+#if __has_feature(objc_arc) && __clang_major__ >= 3
+#define II_ARC_ENABLED 1
+#endif // __has_feature(objc_arc)
#import "WrappedController.h"
@@ -63,6 +66,9 @@ - (void)viewDidUnload
- (void)dealloc {
_wrappedController = nil;
+#if !II_ARC_ENABLED
+ [super dealloc];
+#endif
}
- (void)viewWillAppear:(BOOL)animated

0 comments on commit fa0580e

Please sign in to comment.