From 746ad378c7efe3ee2f4926ab30e5401407f8b3ba Mon Sep 17 00:00:00 2001 From: "David v.Knobelsdorff" Date: Wed, 13 Dec 2023 11:26:04 -0800 Subject: [PATCH] (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 --- .../react-native/React/Base/RCTBridgeModule.h | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/packages/react-native/React/Base/RCTBridgeModule.h b/packages/react-native/React/Base/RCTBridgeModule.h index a43b0b4fccfe93..6cce052695714e 100644 --- a/packages/react-native/React/Base/RCTBridgeModule.h +++ b/packages/react-native/React/Base/RCTBridgeModule.h @@ -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