Skip to content

Commit

Permalink
Suppress warning when checking for JSGlobalContextSetName
Browse files Browse the repository at this point in the history
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
  • Loading branch information
ide authored and facebook-github-bot-9 committed Sep 24, 2015
1 parent 33cc607 commit 944fa4d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions React/Executors/RCTContextExecutor.m
Original file line number Diff line number Diff line change
Expand Up @@ -587,7 +587,10 @@ - (void)injectJSONText:(NSString *)script

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);
Expand Down

0 comments on commit 944fa4d

Please sign in to comment.