Skip to content

Commit

Permalink
to work with iOS13, we need XCode11. to use XCode11, we need to fix a…
Browse files Browse the repository at this point in the history
… bug in RN0.5x.x.

or we will run into "Unknown argument type '__attribute__' in method" when start our app.
see this post for the bug:facebook#25138
this pr for the fix: https://github.com/facebook/react-native/pull/25146/files
  • Loading branch information
Linda Hong committed Sep 23, 2019
1 parent a630a3c commit 071f2e2
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions React/Base/RCTModuleMethod.mm
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,8 @@ static BOOL RCTParseSelectorPart(const char **input, NSMutableString *selector)
static BOOL RCTParseUnused(const char **input)
{
return RCTReadString(input, "__attribute__((unused))") ||
RCTReadString(input, "__unused");
RCTReadString(input, "__attribute__((__unused__))") ||
RCTReadString(input, "__unused");
}

static RCTNullability RCTParseNullability(const char **input)
Expand Down Expand Up @@ -143,20 +144,20 @@ static BOOL checkCallbackMultipleInvocations(BOOL *didInvoke) {
// Parse type
if (RCTReadChar(&input, '(')) {
RCTSkipWhitespace(&input);

// 5 cases that both nullable and __unused exist
// 1: foo:(nullable __unused id)foo 2: foo:(nullable id __unused)foo
// 3: foo:(__unused id _Nullable)foo 4: foo:(id __unused _Nullable)foo
// 5: foo:(id _Nullable __unused)foo
RCTNullability nullability = RCTParseNullability(&input);
RCTSkipWhitespace(&input);

BOOL unused = RCTParseUnused(&input);
RCTSkipWhitespace(&input);

NSString *type = RCTParseType(&input);
RCTSkipWhitespace(&input);

if (nullability == RCTNullabilityUnspecified) {
nullability = RCTParseNullabilityPostfix(&input);
RCTSkipWhitespace(&input);
Expand Down

0 comments on commit 071f2e2

Please sign in to comment.