Skip to content

Commit c1ec597

Browse files
dk-bbuonohamchapman
authored andcommitted
Updating to be compatible with swift 3.2 and above
1 parent bc50239 commit c1ec597

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

Source/CryptoSwiftHMACModule.swift

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ extension UInt32: Initiable {}
328328
extension UInt64: Initiable {}
329329

330330
/** build bit pattern from array of bits */
331-
@_specialize(UInt8)
331+
@_specialize(where T == UInt8)
332332
func integerFrom<T: UnsignedInteger>(_ bits: Array<Bit>) -> T {
333333
var bitPattern: T = 0
334334
for idx in bits.indices {
@@ -935,12 +935,12 @@ extension String {
935935
/** array of bytes */
936936
extension UInt16 {
937937

938-
@_specialize(ArraySlice<UInt8>)
938+
@_specialize(where T == ArraySlice<UInt8>)
939939
init<T: Collection>(bytes: T) where T.Iterator.Element == UInt8, T.Index == Int {
940940
self = UInt16(bytes: bytes, fromIndex: bytes.startIndex)
941941
}
942942

943-
@_specialize(ArraySlice<UInt8>)
943+
@_specialize(where T == ArraySlice<UInt8>)
944944
init<T: Collection>(bytes: T, fromIndex index: T.Index) where T.Iterator.Element == UInt8, T.Index == Int {
945945
let val0 = UInt16(bytes[index.advanced(by: 0)]) << 8
946946
let val1 = UInt16(bytes[index.advanced(by: 1)])
@@ -972,12 +972,12 @@ extension UInt32: _UInt32Type {}
972972
/** array of bytes */
973973
extension UInt32 {
974974

975-
@_specialize(ArraySlice<UInt8>)
975+
@_specialize(where T == ArraySlice<UInt8>)
976976
init<T: Collection>(bytes: T) where T.Iterator.Element == UInt8, T.Index == Int {
977977
self = UInt32(bytes: bytes, fromIndex: bytes.startIndex)
978978
}
979979

980-
@_specialize(ArraySlice<UInt8>)
980+
@_specialize(where T == ArraySlice<UInt8>)
981981
init<T: Collection>(bytes: T, fromIndex index: T.Index) where T.Iterator.Element == UInt8, T.Index == Int {
982982
let val0 = UInt32(bytes[index.advanced(by: 0)]) << 24
983983
let val1 = UInt32(bytes[index.advanced(by: 1)]) << 16
@@ -1002,12 +1002,12 @@ extension UInt32 {
10021002
/** array of bytes */
10031003
extension UInt64 {
10041004

1005-
@_specialize(ArraySlice<UInt8>)
1005+
@_specialize(where T == ArraySlice<UInt8>)
10061006
init<T: Collection>(bytes: T) where T.Iterator.Element == UInt8, T.Index == Int {
10071007
self = UInt64(bytes: bytes, fromIndex: bytes.startIndex)
10081008
}
10091009

1010-
@_specialize(ArraySlice<UInt8>)
1010+
@_specialize(where T == ArraySlice<UInt8>)
10111011
init<T: Collection>(bytes: T, fromIndex index: T.Index) where T.Iterator.Element == UInt8, T.Index == Int {
10121012
let val0 = UInt64(bytes[index.advanced(by: 0)]) << 56
10131013
let val1 = UInt64(bytes[index.advanced(by: 1)]) << 48

0 commit comments

Comments
 (0)