Skip to content

Commit

Permalink
(iOS) Fix strict prototype warning (#41805)
Browse files Browse the repository at this point in the history
Summary:
When using `RCT_EXTERN_REMAP_MODULE` a warning is produced with the following message: "A function declaration without a prototype is deprecated in all versions of C". This warning can be silenced by setting the `CLANG_WARN_STRICT_PROTOTYPES ` build setting. However this PR addresses the underlying problem resulting in no warning messages.

## Changelog:

[IOS] [FIXED] - Fixed strict prototype warning when using the RCT_EXTERN_REMAP_MODULE macro.

Pull Request resolved: #41805

Reviewed By: NickGerleman

Differential Revision: D51891880

Pulled By: dmytrorykun

fbshipit-source-id: 7804d624b248b568643956a8a7b7e0f8540b5ae2
  • Loading branch information
dehlen authored and facebook-github-bot committed Dec 13, 2023
1 parent 3c4517f commit 746ad37
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions packages/react-native/React/Base/RCTBridgeModule.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,15 +85,15 @@ RCT_EXTERN_C_END
* registration. Useful for registering swift classes that forbids use of load
* Used in RCT_EXTERN_REMAP_MODULE
*/
#define RCT_EXPORT_MODULE_NO_LOAD(js_name, objc_name) \
RCT_EXTERN void RCTRegisterModule(Class); \
+(NSString *)moduleName \
{ \
return @ #js_name; \
} \
__attribute__((constructor)) static void RCT_CONCAT(initialize_, objc_name)() \
{ \
RCTRegisterModule([objc_name class]); \
#define RCT_EXPORT_MODULE_NO_LOAD(js_name, objc_name) \
RCT_EXTERN void RCTRegisterModule(Class); \
+(NSString *)moduleName \
{ \
return @ #js_name; \
} \
__attribute__((constructor)) static void RCT_CONCAT(initialize_, objc_name)(void) \
{ \
RCTRegisterModule([objc_name class]); \
}

// Implemented by RCT_EXPORT_MODULE
Expand Down

0 comments on commit 746ad37

Please sign in to comment.