Skip to content

Commit

Permalink
Fix RCTAppSetupPrepareApp import error from .m (#42172)
Browse files Browse the repository at this point in the history
Summary:
This PR tries to fix a build error when `import <React/RCTAppSetupUtils.h>` 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: #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
  • Loading branch information
Kudo authored and facebook-github-bot committed Jan 9, 2024
1 parent f5b824a commit de0c43e
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit de0c43e

Please sign in to comment.