-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Added CVarArg support to NSString and String #2821
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
Conversation
I created Swift PR #32311 to implement a new This PR depends on that one to be approved and merged first. |
Please test with the following: @swift-ci please test |
Adding a reminder that this PR may need to be updated to match the new ObjC constraint on the |
With Swift PR #32311 merged into master, we can now proceed on this one. It is my understanding that this implementation of Foundation expects that there will never by any Objective-C runtime (at least that is what the introductory README states). However, I did find some cases of I can think of a few options...
|
To play it safe, I picked #2. This allows it to build in Xcode using stock Swift without the |
@millenomi Would you mind running the tests when you get a moment? |
@swift-ci please test |
@Molanda we support running SCF for debugging/patch writing purposes only on Darwin (via the Xcode workspace/project in the repository), so please make sure you don't break that. Note that it's a bit of a weird environment, but you will not have Swift code importing the 'real' Darwin Foundation in your process, so it will likely be safe to have the extension around — and you may actually need it since you are using SCF and the bundled CF. |
@swift-ci please test |
Thank you. The builds failed with...
It seems For |
I can build with the On the Swift stdlib side, lorentey had made this suggestion...
@millenomi do you agree with removing (An unrelated note... while looking at the recent merges, I noticed RunLoop.swift has |
@Molanda sorry for the on-and-off; yes, please remove |
(CFString and AnyObject have the same representation — an unmodified pointer to the object.) |
@swift-ci please test |
The failing test is LLDB, not us. |
@swift-ci please test linux |
@millenomi Looks good. Thank you for the help! |
This adds
CVarArg
protocol support toNSString
andString
.NSString
support was easy since%@
already exists forCFString
in CoreFoundation.String
was a little bit more challenging, sincewithVaList
doesn't provide an autorelease pool to retain the requiredNSString
instance, which is needed for theCFString
.I solved this by using
OperationQueue
to schedule the release. I'm not sure if there are any other options at this point.This resolves SR-957.