Skip to content

Commit ac2b8ca

Browse files
Merge pull request #4905 from kateinoigakukun/pr-a79046959cf116072901095068b9a6ebcd87097f
[wasm] Guard out the use of `libdispatch` types
2 parents e333136 + ea22e02 commit ac2b8ca

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

CoreFoundation/Base.subproj/CFInternal.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -1203,12 +1203,13 @@ CF_INLINE dispatch_queue_t __CFDispatchQueueGetGenericBackground(void) {
12031203
return dispatch_get_global_queue(QOS_CLASS_UTILITY, DISPATCH_QUEUE_OVERCOMMIT);
12041204
}
12051205

1206+
CF_PRIVATE dispatch_data_t _CFDataCreateDispatchData(CFDataRef data); //avoids copying in most cases
1207+
12061208
#endif
12071209

12081210
CF_PRIVATE CFStringRef _CFStringCopyBundleUnloadingProtectedString(CFStringRef str);
12091211

12101212
CF_PRIVATE uint8_t *_CFDataGetBytePtrNonObjC(CFDataRef data);
1211-
CF_PRIVATE dispatch_data_t _CFDataCreateDispatchData(CFDataRef data); //avoids copying in most cases
12121213

12131214
// Use this for functions that are intended to be breakpoint hooks. If you do not, the compiler may optimize them away.
12141215
// Based on: BREAKPOINT_FUNCTION in objc-os.h

CoreFoundation/Stream.subproj/CFStream.h

+5-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,10 @@
1717
#include <CoreFoundation/CFRunLoop.h>
1818
#include <CoreFoundation/CFSocket.h>
1919
#include <CoreFoundation/CFError.h>
20+
21+
#if __HAS_DISPATCH__
2022
#include <dispatch/dispatch.h>
23+
#endif
2124

2225
CF_IMPLICIT_BRIDGING_ENABLED
2326
CF_EXTERN_C_BEGIN
@@ -456,7 +459,7 @@ void CFReadStreamUnscheduleFromRunLoop(CFReadStreamRef _Null_unspecified stream,
456459
CF_EXPORT
457460
void CFWriteStreamUnscheduleFromRunLoop(CFWriteStreamRef _Null_unspecified stream, CFRunLoopRef _Null_unspecified runLoop, CFRunLoopMode _Null_unspecified runLoopMode);
458461

459-
462+
#if __HAS_DISPATCH__
460463
/*
461464
* Specify the dispatch queue upon which the client callbacks will be invoked.
462465
* Passing NULL for the queue will prevent future callbacks from being invoked.
@@ -480,6 +483,7 @@ dispatch_queue_t _Null_unspecified CFReadStreamCopyDispatchQueue(CFReadStreamRef
480483

481484
CF_EXPORT
482485
dispatch_queue_t _Null_unspecified CFWriteStreamCopyDispatchQueue(CFWriteStreamRef _Null_unspecified stream) API_AVAILABLE(macos(10.9), ios(7.0), watchos(2.0), tvos(9.0));
486+
#endif
483487

484488

485489
/* The following API is deprecated starting in 10.5; please use CFRead/WriteStreamCopyError(), above, instead */

0 commit comments

Comments
 (0)