Skip to content

[CF] TARGET_OS_BSD for FS representation behavior. #2680

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

3405691582
Copy link
Member

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.

#endif
#if TARGET_OS_MAC || TARGET_OS_LINUX

#if TARGET_OS_MAC || TARGET_OS_LINUX || TARGET_OS_BSD
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be better to make this an #if !TARGET_OS_WIN32 else this function will always return false when run on something that isn't a listed platform?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CF only mentions kCFURLPOSIXPathStyle or kCFURLWindowsPathStyle(kCFURLHFSPathStyle is deprecated). So I think in this case your suggestion makes sense to make this a binary conditional.

However, we should probably invert sense in that case: TARGET_OS_WIN32 comes first, and POSIX is an #else.

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.
@3405691582 3405691582 force-pushed the CFURL_FileSystemRepresentation branch from 388c172 to 6026766 Compare February 20, 2020 01:56
@spevans
Copy link
Contributor

spevans commented Feb 20, 2020

@wift-ci test linux

@3405691582
Copy link
Member Author

Looks like you typo'd the @ there :)

@compnerd
Copy link
Member

@swift-ci please test Linux platform

@3405691582
Copy link
Member Author

Can someone re-run this? The failure in the run looks unrelated.

@xedin
Copy link
Contributor

xedin commented Feb 22, 2020

@swift-ci please test Linux platform

@compnerd
Copy link
Member

I think that this is ready, lets get it merged.

@compnerd compnerd merged commit e6be742 into swiftlang:master Mar 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants