Skip to content

Commit 45eaf73

Browse files
Stewart Milespaulb777
Stewart Miles
authored andcommitted
Changed FDL to use compatible __typeof__() operator. (#1982)
typeof() is not supported in some C language dialects which causes issues when integrating FDL in projects that do use non-GNU compiler modes. For example, this causes problems when building in some versions of Unity firebase/quickstart-unity#228
1 parent 9fe54ed commit 45eaf73

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

Firebase/DynamicLinks/FIRDLDefaultRetrievalProcessV2.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,11 +123,11 @@ - (void)retrievePendingDynamicLinkInternal {
123123
}
124124
NSURL *uniqueMatchLinkToCheck = [self uniqueMatchLinkToCheck];
125125

126-
__weak typeof(self) weakSelf = self;
126+
__weak __typeof__(self) weakSelf = self;
127127
FIRPostInstallAttributionCompletionHandler completionHandler =
128128
^(NSDictionary *_Nullable dynamicLinkParameters, NSString *_Nullable matchMessage,
129129
NSError *_Nullable error) {
130-
typeof(self) strongSelf = weakSelf;
130+
__typeof__(self) strongSelf = weakSelf;
131131
if (!strongSelf) {
132132
return;
133133
}

Firebase/DynamicLinks/FIRDynamicLinks.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -422,10 +422,10 @@ - (nullable FIRDynamicLink *)dynamicLinkFromUniversalLinkURL:(NSURL *)url {
422422
- (BOOL)handleUniversalLink:(NSURL *)universalLinkURL
423423
completion:(FIRDynamicLinkUniversalLinkHandler)completion {
424424
if ([self matchesShortLinkFormat:universalLinkURL]) {
425-
__weak typeof(self) weakSelf = self;
425+
__weak __typeof__(self) weakSelf = self;
426426
[self resolveShortLink:universalLinkURL
427427
completion:^(NSURL *url, NSError *error) {
428-
typeof(self) strongSelf = weakSelf;
428+
__typeof__(self) strongSelf = weakSelf;
429429
if (strongSelf) {
430430
FIRDynamicLink *dynamicLink = [strongSelf dynamicLinkFromCustomSchemeURL:url];
431431
dispatch_async(dispatch_get_main_queue(), ^{

0 commit comments

Comments
 (0)