From 5e984be9e46049a694a0c441a3be2fc1db3a30f9 Mon Sep 17 00:00:00 2001 From: Saad Najmi Date: Thu, 15 Oct 2026 11:12:35 -0700 Subject: [PATCH] fix(macos): define the layout direction constants as NSUserInterfaceLayoutDirection values On macOS, RCTUIKit makes UIUserInterfaceLayoutDirection an alias of NSUserInterfaceLayoutDirection, but declared the LeftToRight and RightToLeft constants in a separate, unnamed enum. Comparing a layout direction with them, as RCTTextAttributes.mm does, mixes two enumeration types, which C++20 deprecates and clang reports with -Wdeprecated-anon-enum-enum-conversion. Define the constants as the NSUserInterfaceLayoutDirection values, like the type. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 33ac4470-c1d2-43c0-92ee-8407909f0f6a --- .../ReactApple/Libraries/RCTUIKit/RCTUIKitCompat.h | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/packages/react-native/ReactApple/Libraries/RCTUIKit/RCTUIKitCompat.h b/packages/react-native/ReactApple/Libraries/RCTUIKit/RCTUIKitCompat.h index db409fea1ab2..f74d46e2e6d3 100644 --- a/packages/react-native/ReactApple/Libraries/RCTUIKit/RCTUIKitCompat.h +++ b/packages/react-native/ReactApple/Libraries/RCTUIKit/RCTUIKitCompat.h @@ -198,11 +198,8 @@ typedef NS_ENUM(NSInteger, UIViewContentMode) { }; // UIUserInterfaceLayoutDirection -enum : NSInteger -{ - UIUserInterfaceLayoutDirectionLeftToRight = NSUserInterfaceLayoutDirectionLeftToRight, - UIUserInterfaceLayoutDirectionRightToLeft = NSUserInterfaceLayoutDirectionRightToLeft, -}; +#define UIUserInterfaceLayoutDirectionLeftToRight NSUserInterfaceLayoutDirectionLeftToRight +#define UIUserInterfaceLayoutDirectionRightToLeft NSUserInterfaceLayoutDirectionRightToLeft // UIActivityIndicatorViewStyle typedef NS_ENUM(NSInteger, UIActivityIndicatorViewStyle) {