diff --git a/stdlib/public/Darwin/Foundation/Data.swift b/stdlib/public/Darwin/Foundation/Data.swift index a5f0b0fc802e1..1131214cac2e9 100644 --- a/stdlib/public/Darwin/Foundation/Data.swift +++ b/stdlib/public/Darwin/Foundation/Data.swift @@ -683,15 +683,15 @@ public struct Data : ReferenceConvertible, Equatable, Hashable, RandomAccessColl @usableFromInline typealias Buffer = (UInt8, UInt8, UInt8, UInt8, UInt8, UInt8, UInt8, UInt8, UInt8, UInt8, UInt8, UInt8, UInt8, UInt8) //len //enum - @usableFromInline - var bytes: Buffer -#elseif arch(i386) || arch(arm) +#elseif arch(i386) || arch(arm) || arch(arm64_32) @usableFromInline typealias Buffer = (UInt8, UInt8, UInt8, UInt8, UInt8, UInt8) //len //enum +#else + #error ("Unsupported architecture: a definition of Buffer needs to be made with N = (MemoryLayout<(Int, Int)>.size - 2) UInt8 members to a tuple") +#endif @usableFromInline var bytes: Buffer -#endif @usableFromInline var length: UInt8 @@ -720,9 +720,11 @@ public struct Data : ReferenceConvertible, Equatable, Hashable, RandomAccessColl assert(count <= MemoryLayout.size) #if arch(x86_64) || arch(arm64) || arch(s390x) || arch(powerpc64) || arch(powerpc64le) bytes = (UInt8(0), UInt8(0), UInt8(0), UInt8(0), UInt8(0), UInt8(0), UInt8(0), UInt8(0), UInt8(0), UInt8(0), UInt8(0), UInt8(0), UInt8(0), UInt8(0)) -#elseif arch(i386) || arch(arm) +#elseif arch(i386) || arch(arm) || arch(arm64_32) bytes = (UInt8(0), UInt8(0), UInt8(0), UInt8(0), UInt8(0), UInt8(0)) +#else + #error ("Unsupported architecture: initialization for Buffer is required for this architecture") #endif length = UInt8(count) } @@ -878,9 +880,11 @@ public struct Data : ReferenceConvertible, Equatable, Hashable, RandomAccessColl #if arch(x86_64) || arch(arm64) || arch(s390x) || arch(powerpc64) || arch(powerpc64le) @usableFromInline internal typealias HalfInt = Int32 -#elseif arch(i386) || arch(arm) +#elseif arch(i386) || arch(arm) || arch(arm64_32) @usableFromInline internal typealias HalfInt = Int16 +#else + #error ("Unsupported architecture: a definition of half of the pointer sized Int needs to be defined for this architecture") #endif @usableFromInline