From 862fbde1801b3122f445c63290986ae300d9f6a9 Mon Sep 17 00:00:00 2001 From: Brian Quinlan Date: Mon, 25 Nov 2024 16:48:23 -0800 Subject: [PATCH] Make symbol visible --- .../Sources/cupertino_http/utils.h | 19 ------------------- .../Sources/cupertino_http/utils.m | 19 +++++++++++++++++-- 2 files changed, 17 insertions(+), 21 deletions(-) delete mode 100644 pkgs/cupertino_http/darwin/cupertino_http/Sources/cupertino_http/utils.h diff --git a/pkgs/cupertino_http/darwin/cupertino_http/Sources/cupertino_http/utils.h b/pkgs/cupertino_http/darwin/cupertino_http/Sources/cupertino_http/utils.h deleted file mode 100644 index 490b1d70b7..0000000000 --- a/pkgs/cupertino_http/darwin/cupertino_http/Sources/cupertino_http/utils.h +++ /dev/null @@ -1,19 +0,0 @@ -#import -#import -#import -#include - -#if !__has_feature(objc_arc) -#error "This file must be compiled with ARC enabled" -#endif - -typedef void (^_DidFinish)(void *closure, NSURLSession *session, - NSURLSessionDownloadTask *downloadTask, - NSURL *location); -typedef void (^_DidFinishWithLock)(NSCondition *lock, NSURLSession *session, - NSURLSessionDownloadTask *downloadTask, - NSURL *location); -/// Create a block useable as a -/// `URLSession:downloadTask:didFinishDownloadingToURL:` that can be used to -/// make an async Dart callback behave synchronously. -_DidFinish adaptFinishWithLock(_DidFinishWithLock block); diff --git a/pkgs/cupertino_http/darwin/cupertino_http/Sources/cupertino_http/utils.m b/pkgs/cupertino_http/darwin/cupertino_http/Sources/cupertino_http/utils.m index bad263c96c..d990d5b967 100644 --- a/pkgs/cupertino_http/darwin/cupertino_http/Sources/cupertino_http/utils.m +++ b/pkgs/cupertino_http/darwin/cupertino_http/Sources/cupertino_http/utils.m @@ -1,6 +1,21 @@ -#import "utils.h" +#import +#import +#import +#include -_DidFinish adaptFinishWithLock(_DidFinishWithLock block) { +#if !__has_feature(objc_arc) +#error "This file must be compiled with ARC enabled" +#endif + +typedef void (^_DidFinish)(void *closure, NSURLSession *session, + NSURLSessionDownloadTask *downloadTask, + NSURL *location); +typedef void (^_DidFinishWithLock)(NSCondition *lock, NSURLSession *session, + NSURLSessionDownloadTask *downloadTask, + NSURL *location); + +__attribute__((visibility("default"))) __attribute__((used)) _DidFinish +adaptFinishWithLock(_DidFinishWithLock block) { return ^void(void *closure, NSURLSession *session, NSURLSessionDownloadTask *downloadTask, NSURL *location) { NSCondition *lock = [[NSCondition alloc] init];