Support macOS 10.15, iOS 13, tvOS 13, and watchOS 6 #18
+39
−8
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I would like to use
swift-png
on macOS versions earlier than macOS 13.3, and afaictswift-hash
is the only reason thatswift-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
@available
annotations toExpressibleByIntegerLiteral
implementations that rely onStaticBigInt
#available
to provide an alternativeCustomStringConvertible
implementation forInlineBuffer
whenString.init(unsafeUninitializedCapacity:initializingUTF8With:)
isn't availableMD5Tests
to macOS 13.3+ since those tests rely heavily on being able to expressMD5
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 postmacOS 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 😅).