From 1bf7e39cef1629d58958ccf9f290d0774e0d6289 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Bert?= <63123542+m-bert@users.noreply.github.com> Date: Thu, 24 Oct 2024 15:07:46 +0200 Subject: [PATCH] [macOS] Fix build on old architecture (#3182) ## Description Currently macOS fails to build on old architecture. This PR fixes that. ## Test plan Run MacOSExample on paper. --- apple/RNGestureHandlerButton.h | 8 ++++++-- apple/RNGestureHandlerButton.mm | 6 +++++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/apple/RNGestureHandlerButton.h b/apple/RNGestureHandlerButton.h index 3514c3cb26..be5199a23b 100644 --- a/apple/RNGestureHandlerButton.h +++ b/apple/RNGestureHandlerButton.h @@ -10,21 +10,25 @@ #if TARGET_OS_OSX +#if RCT_NEW_ARCH_ENABLED + #include @protocol RCTComponentViewProtocol; +#endif // RCT_NEW_ARCH_ENABLED + @interface RNGestureHandlerButton : NSControl #else @interface RNGestureHandlerButton : UIControl -#endif +#endif // TARGET_OS_OSX /** * Insets used when hit testing inside this view. */ @property (nonatomic, assign) UIEdgeInsets hitTestEdgeInsets; @property (nonatomic) BOOL userEnabled; -#if TARGET_OS_OSX +#if TARGET_OS_OSX && RCT_NEW_ARCH_ENABLED - (void)mountChildComponentView:(RNGHUIView *)childComponentView index:(NSInteger)index; - (void)unmountChildComponentView:(RNGHUIView *)childComponentView index:(NSInteger)index; - (void)updateLayoutMetrics:(const facebook::react::LayoutMetrics &)layoutMetrics diff --git a/apple/RNGestureHandlerButton.mm b/apple/RNGestureHandlerButton.mm index a48317fad8..3729eb18ba 100644 --- a/apple/RNGestureHandlerButton.mm +++ b/apple/RNGestureHandlerButton.mm @@ -14,9 +14,13 @@ #import #endif +#if RCT_NEW_ARCH_ENABLED + #import #import +#endif + /** * Gesture Handler Button components overrides standard mechanism used by RN * to determine touch target, which normally would reurn the UIView that is placed @@ -87,7 +91,7 @@ - (RNGHUIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event } #endif -#if TARGET_OS_OSX +#if TARGET_OS_OSX && RCT_NEW_ARCH_ENABLED - (void)mountChildComponentView:(RNGHUIView *)childComponentView index:(NSInteger)index { if (childComponentView.superview != nil) {