From de0c43ead4d1503e708d2dafa3f5b7fc550fc01a Mon Sep 17 00:00:00 2001 From: Kudo Chien Date: Tue, 9 Jan 2024 02:34:49 -0800 Subject: [PATCH] Fix RCTAppSetupPrepareApp import error from .m (#42172) Summary: This PR tries to fix a build error when `import ` from *.m files. Since the `[[deprecated("")]]` syntax is a C++14 feature and it was placed inside the `RCT_EXTERN_C_BEGIN` block. If the file in imported from Objective-C *.m files or Swift files, it will have a syntax error. Instead of using the C++ syntax, this PR uses the `__deprecated_msg()` statement that is also used in other code in react-native and that is C supported syntax. bypass-github-export-checks ## Changelog: [IOS] [FIXED] - Fix RCTAppSetupPrepareApp.h import error from Objective-C *.m files Pull Request resolved: https://github.com/facebook/react-native/pull/42172 Test Plan: - test building and importing **RCTAppSetupPrepareApp.h** from a *.m file - test `RCTAppSetupPrepareApp(application, turboModuleEnabled)` will show a compile warning Reviewed By: arushikesarwani94 Differential Revision: D52603421 Pulled By: cipolleschi fbshipit-source-id: bfec8d0ba6378a265ad30dd8ca1d3ab15cff96ed --- .../react-native/Libraries/AppDelegate/RCTAppSetupUtils.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/react-native/Libraries/AppDelegate/RCTAppSetupUtils.h b/packages/react-native/Libraries/AppDelegate/RCTAppSetupUtils.h index 095a002ee748db..ad48fa19bcbf1c 100644 --- a/packages/react-native/Libraries/AppDelegate/RCTAppSetupUtils.h +++ b/packages/react-native/Libraries/AppDelegate/RCTAppSetupUtils.h @@ -55,9 +55,8 @@ void RCTAppSetupPrepareApp( RCT_EXTERN_C_BEGIN -[[deprecated("Use the 3-argument overload of RCTAppSetupPrepareApp instead")]] void RCTAppSetupPrepareApp( - UIApplication *application, - BOOL turboModuleEnabled); +void RCTAppSetupPrepareApp(UIApplication *application, BOOL turboModuleEnabled) + __deprecated_msg("Use the 3-argument overload of RCTAppSetupPrepareApp instead"); UIView *RCTAppSetupDefaultRootView( RCTBridge *bridge,