diff --git a/Sources/NIOFoundationCompat/ByteBuffer-foundation.swift b/Sources/NIOFoundationCompat/ByteBuffer-foundation.swift index 271707ad83..fd6362bf7f 100644 --- a/Sources/NIOFoundationCompat/ByteBuffer-foundation.swift +++ b/Sources/NIOFoundationCompat/ByteBuffer-foundation.swift @@ -375,9 +375,17 @@ extension ByteBufferAllocator { } // MARK: - Conformances +#if compiler(>=5.11) +extension ByteBufferView: @retroactive ContiguousBytes {} +extension ByteBufferView: @retroactive DataProtocol {} +extension ByteBufferView: @retroactive MutableDataProtocol {} +#else extension ByteBufferView: ContiguousBytes {} +extension ByteBufferView: DataProtocol {} +extension ByteBufferView: MutableDataProtocol {} +#endif -extension ByteBufferView: DataProtocol { +extension ByteBufferView { public typealias Regions = CollectionOfOne public var regions: CollectionOfOne { @@ -385,8 +393,6 @@ extension ByteBufferView: DataProtocol { } } -extension ByteBufferView: MutableDataProtocol {} - // MARK: - Data extension Data {