Skip to content

Commit

Permalink
Merge pull request #4905 from kateinoigakukun/pr-a79046959cf116072901…
Browse files Browse the repository at this point in the history
…095068b9a6ebcd87097f

[wasm] Guard out the use of `libdispatch` types
  • Loading branch information
kateinoigakukun committed Mar 8, 2024
2 parents e333136 + ea22e02 commit ac2b8ca
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
3 changes: 2 additions & 1 deletion CoreFoundation/Base.subproj/CFInternal.h
Expand Up @@ -1203,12 +1203,13 @@ CF_INLINE dispatch_queue_t __CFDispatchQueueGetGenericBackground(void) {
return dispatch_get_global_queue(QOS_CLASS_UTILITY, DISPATCH_QUEUE_OVERCOMMIT);
}

CF_PRIVATE dispatch_data_t _CFDataCreateDispatchData(CFDataRef data); //avoids copying in most cases

#endif

CF_PRIVATE CFStringRef _CFStringCopyBundleUnloadingProtectedString(CFStringRef str);

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

// Use this for functions that are intended to be breakpoint hooks. If you do not, the compiler may optimize them away.
// Based on: BREAKPOINT_FUNCTION in objc-os.h
Expand Down
6 changes: 5 additions & 1 deletion CoreFoundation/Stream.subproj/CFStream.h
Expand Up @@ -17,7 +17,10 @@
#include <CoreFoundation/CFRunLoop.h>
#include <CoreFoundation/CFSocket.h>
#include <CoreFoundation/CFError.h>

#if __HAS_DISPATCH__
#include <dispatch/dispatch.h>
#endif

CF_IMPLICIT_BRIDGING_ENABLED
CF_EXTERN_C_BEGIN
Expand Down Expand Up @@ -456,7 +459,7 @@ void CFReadStreamUnscheduleFromRunLoop(CFReadStreamRef _Null_unspecified stream,
CF_EXPORT
void CFWriteStreamUnscheduleFromRunLoop(CFWriteStreamRef _Null_unspecified stream, CFRunLoopRef _Null_unspecified runLoop, CFRunLoopMode _Null_unspecified runLoopMode);


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

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


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

0 comments on commit ac2b8ca

Please sign in to comment.