Skip to content

Commit

Permalink
Fix headers
Browse files Browse the repository at this point in the history
  • Loading branch information
brianquinlan committed Nov 26, 2024
1 parent 862fbde commit d961c2f
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 17 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#import <Foundation/NSLock.h>
#import <Foundation/NSURL.h>
#import <Foundation/NSURLSession.h>
#include <stdint.h>

#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.
__attribute__((visibility("default"))) __attribute__((used))
_DidFinish adaptFinishWithLock(_DidFinishWithLock block);
Original file line number Diff line number Diff line change
@@ -1,21 +1,6 @@
#import <Foundation/NSLock.h>
#import <Foundation/NSURL.h>
#import <Foundation/NSURLSession.h>
#include <stdint.h>
#include "utils.h"

#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) {
_DidFinish adaptFinishWithLock(_DidFinishWithLock block) {
return ^void(void *closure, NSURLSession *session,
NSURLSessionDownloadTask *downloadTask, NSURL *location) {
NSCondition *lock = [[NSCondition alloc] init];
Expand Down

0 comments on commit d961c2f

Please sign in to comment.