diff --git a/Sources/NIOFoundationCompat/ByteBuffer-foundation.swift b/Sources/NIOFoundationCompat/ByteBuffer-foundation.swift index fd6362bf7f..11d4c7e183 100644 --- a/Sources/NIOFoundationCompat/ByteBuffer-foundation.swift +++ b/Sources/NIOFoundationCompat/ByteBuffer-foundation.swift @@ -375,7 +375,8 @@ extension ByteBufferAllocator { } // MARK: - Conformances -#if compiler(>=5.11) +#if swift(>=5.8) +#if hasFeature(RetroactiveAttribute) extension ByteBufferView: @retroactive ContiguousBytes {} extension ByteBufferView: @retroactive DataProtocol {} extension ByteBufferView: @retroactive MutableDataProtocol {} @@ -384,6 +385,11 @@ extension ByteBufferView: ContiguousBytes {} extension ByteBufferView: DataProtocol {} extension ByteBufferView: MutableDataProtocol {} #endif +#else +extension ByteBufferView: ContiguousBytes {} +extension ByteBufferView: DataProtocol {} +extension ByteBufferView: MutableDataProtocol {} +#endif extension ByteBufferView { public typealias Regions = CollectionOfOne