Skip to content

Commit 944fa4d

Browse files
idefacebook-github-bot-9
authored andcommitted
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 facebook#2475 Reviewed By: @​trunkagent, @vjeux Differential Revision: D2443432 Pulled By: @tadeuzagallo
1 parent 33cc607 commit 944fa4d

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

React/Executors/RCTContextExecutor.m

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -587,7 +587,10 @@ - (void)injectJSONText:(NSString *)script
587587

588588
RCT_EXPORT_METHOD(setContextName:(nonnull NSString *)name)
589589
{
590+
#pragma clang diagnostic push
591+
#pragma clang diagnostic ignored "-Wtautological-pointer-compare"
590592
if (JSGlobalContextSetName != NULL) {
593+
#pragma clang diagnostic pop
591594
JSStringRef JSName = JSStringCreateWithCFString((__bridge CFStringRef)name);
592595
JSGlobalContextSetName(_context.ctx, JSName);
593596
JSStringRelease(JSName);

0 commit comments

Comments
 (0)