Skip to content

Commit 388c172

Browse files
committed
[CF] TARGET_OS_BSD for FS representation behavior.
CFURLGetFileSystemRepresentation's implementation has TARGET_OS_MAC and TARGET_OS_LINUX, but not TARGET_OS_BSD. Nothing here appears macOS or Linux specific, and things seem to work okay with TARGET_OS_BSD, so enable it here too. This also requires CanonicalFileURLStringToFileSystemRepresentation to be exposed.
1 parent 7d0f3ea commit 388c172

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

CoreFoundation/URL.subproj/CFURL.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4064,7 +4064,7 @@ static CFStringRef URLPathToPOSIXPath(CFStringRef path, CFAllocatorRef allocator
40644064
return result;
40654065
}
40664066

4067-
#if TARGET_OS_MAC || TARGET_OS_LINUX
4067+
#if TARGET_OS_MAC || TARGET_OS_LINUX || TARGET_OS_BSD
40684068
static Boolean CanonicalFileURLStringToFileSystemRepresentation(CFStringRef str, UInt8 *inBuffer, CFIndex inBufferLen)
40694069
{
40704070
size_t fileURLPrefixLength;
@@ -4534,13 +4534,12 @@ CFStringRef CFURLCreateStringWithFileSystemPath(CFAllocatorRef allocator, CFURLR
45344534
}
45354535

45364536
Boolean CFURLGetFileSystemRepresentation(CFURLRef url, Boolean resolveAgainstBase, uint8_t *buffer, CFIndex bufLen) {
4537-
#if TARGET_OS_MAC || TARGET_OS_LINUX || TARGET_OS_WIN32
45384537
CFAllocatorRef alloc = CFGetAllocator(url);
45394538
CFStringRef path;
45404539

45414540
if (!url) return false;
4542-
#endif
4543-
#if TARGET_OS_MAC || TARGET_OS_LINUX
4541+
4542+
#if TARGET_OS_MAC || TARGET_OS_LINUX || TARGET_OS_BSD
45444543
if ( !resolveAgainstBase || (CFURLGetBaseURL(url) == NULL) ) {
45454544
if (!CF_IS_OBJC(CFURLGetTypeID(), url)) {
45464545
// We can access the ivars

0 commit comments

Comments
 (0)