From 009d80bf5a55dd74be448960b1344ac7599c6bae Mon Sep 17 00:00:00 2001 From: Arthur Kushka Date: Fri, 11 Mar 2022 06:56:10 -0800 Subject: [PATCH] Dropped `using namespace` from TurboModuleUtils.h Summary: using namespace in header file is a bad practice due to many reasons as well as discouraged by `-Wheader-hygiene` compiler flag which is default for many apps https://stackoverflow.com/questions/5849457/using-namespace-in-c-headers Changelog: [General][Fixed] - Fixed compilation warning due to `using namespace` being used as part of header Reviewed By: nlutsenko Differential Revision: D34788523 fbshipit-source-id: 2a50fbf2ac3371ff5670c600c7f5ad9055060ad2 --- .../react/turbomodule/core/jni/ReactCommon/OnLoad.cpp | 6 +++--- .../react/nativemodule/core/ReactCommon/TurboModuleUtils.h | 2 -- .../react/nativemodule/core/platform/ios/RCTTurboModule.mm | 1 + .../nativemodule/core/platform/ios/RCTTurboModuleManager.mm | 1 + 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ReactAndroid/src/main/java/com/facebook/react/turbomodule/core/jni/ReactCommon/OnLoad.cpp b/ReactAndroid/src/main/java/com/facebook/react/turbomodule/core/jni/ReactCommon/OnLoad.cpp index 4e1f74c0a8b9b3..ac7f63afe6cdd2 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/turbomodule/core/jni/ReactCommon/OnLoad.cpp +++ b/ReactAndroid/src/main/java/com/facebook/react/turbomodule/core/jni/ReactCommon/OnLoad.cpp @@ -12,9 +12,9 @@ #include "TurboModuleManager.h" void jniEnableCppLogging( - jni::alias_ref cls, - jni::alias_ref - perfLogger) { + facebook::jni::alias_ref cls, + facebook::jni::alias_ref< + facebook::react::JNativeModulePerfLogger::javaobject> perfLogger) { facebook::react::TurboModulePerfLogger::enableLogging( perfLogger->cthis()->get()); } diff --git a/ReactCommon/react/nativemodule/core/ReactCommon/TurboModuleUtils.h b/ReactCommon/react/nativemodule/core/ReactCommon/TurboModuleUtils.h index dd223f29729168..4515841cc086f9 100644 --- a/ReactCommon/react/nativemodule/core/ReactCommon/TurboModuleUtils.h +++ b/ReactCommon/react/nativemodule/core/ReactCommon/TurboModuleUtils.h @@ -15,8 +15,6 @@ #include #include -using namespace facebook; - namespace facebook { namespace react { diff --git a/ReactCommon/react/nativemodule/core/platform/ios/RCTTurboModule.mm b/ReactCommon/react/nativemodule/core/platform/ios/RCTTurboModule.mm index b4df4ba406b4bc..9ccbbc4ef87fc3 100644 --- a/ReactCommon/react/nativemodule/core/platform/ios/RCTTurboModule.mm +++ b/ReactCommon/react/nativemodule/core/platform/ios/RCTTurboModule.mm @@ -27,6 +27,7 @@ #import #import +using namespace facebook; using namespace facebook::react; static int32_t getUniqueId() diff --git a/ReactCommon/react/nativemodule/core/platform/ios/RCTTurboModuleManager.mm b/ReactCommon/react/nativemodule/core/platform/ios/RCTTurboModuleManager.mm index d795920309e449..6b63449d78b344 100644 --- a/ReactCommon/react/nativemodule/core/platform/ios/RCTTurboModuleManager.mm +++ b/ReactCommon/react/nativemodule/core/platform/ios/RCTTurboModuleManager.mm @@ -28,6 +28,7 @@ #import #import +using namespace facebook; using namespace facebook::react; /**