-
Notifications
You must be signed in to change notification settings - Fork 285
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
Prepare QS to include Swift #3023
base: main
Are you sure you want to change the base?
Conversation
n8henrie
commented
Jan 26, 2025
- macos-12 runner is deprecated
- Remove complex macros, which break compilation with Swift
- Remove complex macros, which are incompatible with Swift
- Add missing imports
- Add blank swift file
- Use Swift 6.0
- Fix minimum version message and https URL
- Remove outdated version target
- Add bare minimum to run swift from objc
- Swift 6.0 not avail in GHA runners at this point (xcode 15), stick to swift 5 for now
- Remove dummy Swift code
Follow `macos-latest`; if issues come up, can always temporarily pin to the latest working version
https://developer.apple.com/documentation/swift/using-imported-c-macros-in-swift#Use-Functions-and-Generics-Instead-of-Complex-Macros > C macros that are more complex than simple constant definitions have > no counterpart in Swift. You use complex macros in C and Objective-C > to avoid type-checking constraints or to avoid retyping large amounts > of boilerplate code. However, macros can make debugging and refactoring > difficult. In Swift, you can use functions and generics to achieve the > same results without any compromises.
Probably should squash when / if these are merged. @pjrobertson looking forward to your review! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Built and ran it locally to be sure, but looks good!
Also, you can just create branches in this repo. No need to have a fork once you have access here.
@@ -3,6 +3,8 @@ | |||
#import "QSDebug.h" | |||
#import "QSObjectHandler.h" | |||
|
|||
#import <QSCore/QSCore-Swift.h> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this used?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not at the moment, but I intentionally left it in to help ensure that the remainder of the swift compilation continued to work. There seem to be a few fiddly bits with the xcode config in this PR, so I wanted to make sure that work wasn't lost (or at least that the breakage was loud) if there were changes in the interim, prior to real Swift work.
I could add a comment to that effect.