mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-03-27 22:54:46 +08:00
Suppress warning when checking for JSGlobalContextSetName
Summary: This API is defined only on iOS 8 and newer. There is a warning that the function is defined when checking if it exists since it is always defined in the iOS 8 SDK but not necessarily on iOS 7 phones. Use pragmas to silence the warning. Closes https://github.com/facebook/react-native/pull/2475 Reviewed By: @trunkagent, @vjeux Differential Revision: D2443432 Pulled By: @tadeuzagallo
This commit is contained in:
committed by
facebook-github-bot-9
parent
33cc607c1f
commit
944fa4d635
@@ -587,7 +587,10 @@ static void RCTInstallJSCProfiler(RCTBridge *bridge, JSContextRef context)
|
||||
|
||||
RCT_EXPORT_METHOD(setContextName:(nonnull NSString *)name)
|
||||
{
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wtautological-pointer-compare"
|
||||
if (JSGlobalContextSetName != NULL) {
|
||||
#pragma clang diagnostic pop
|
||||
JSStringRef JSName = JSStringCreateWithCFString((__bridge CFStringRef)name);
|
||||
JSGlobalContextSetName(_context.ctx, JSName);
|
||||
JSStringRelease(JSName);
|
||||
|
||||
Reference in New Issue
Block a user