Skip to content
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

Support macOS 10.15, iOS 13, tvOS 13, and watchOS 6 #18

Merged
merged 1 commit into from
Sep 2, 2024

Conversation

stackotter
Copy link
Contributor

I would like to use swift-png on macOS versions earlier than macOS 13.3, and afaict swift-hash is the only reason that swift-png requires macOS 13.3+. The changes to support macOS versions back to 10.15 were luckily pretty minimal. While I was at it I also added the corresponding iOS, tvOS, etc versions to my availability checks (but I haven't tested compilation on those platforms, only on macOS).

Changes

  • Added @available annotations to ExpressibleByIntegerLiteral implementations that rely on StaticBigInt
  • Used #available to provide an alternative CustomStringConvertible implementation for InlineBuffer when String.init(unsafeUninitializedCapacity:initializingUTF8With:) isn't available
  • Limited MD5Tests to macOS 13.3+ since those tests rely heavily on being able to express MD5 using integer literals. This was achieved using a runtime check because I couldn't find a way to make it a compile-time check (there doesn't seem to be compile-time conditional that allows checking platform versions), but if you know a way I'd be happy to update my implementation.

The alternative implementation for InlineBuffer.description probably isn't as efficient as the post macOS 11 implementation unless the compiler does something clever, but given that the older platforms weren't supported at all before I reckon this is an ok compromise (and swift-png doesn't rely on that part of the code 😅).

@tayloraswift tayloraswift merged commit 4d70a94 into tayloraswift:master Sep 2, 2024
2 checks passed
@tayloraswift
Copy link
Owner

thanks! 💝

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.

2 participants