mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
(iOS) Fix strict prototype warning (#41805)
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: https://github.com/facebook/react-native/pull/41805 Reviewed By: NickGerleman Differential Revision: D51891880 Pulled By: dmytrorykun fbshipit-source-id: 7804d624b248b568643956a8a7b7e0f8540b5ae2
This commit is contained in:
committed by
Facebook GitHub Bot
parent
3c4517ffb6
commit
746ad378c7
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user